X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fsoft-sensor-manager%2FSDK%2Fjava%2Forg%2Fiotivity%2Fservice%2Fssm%2FModelData.java;h=c276f832651258b531f30dc2cf3010cfe2fea32e;hb=935fdb9b67b6c10d007e652e9e2e028fd6ccfe09;hp=c43e1df31bf74783084b895982e0c23c72429541;hpb=00b3660e45c56cb3db35dc2596a054f801b5591a;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/soft-sensor-manager/SDK/java/org/iotivity/service/ssm/ModelData.java b/service/soft-sensor-manager/SDK/java/org/iotivity/service/ssm/ModelData.java index c43e1df..c276f83 100644 --- a/service/soft-sensor-manager/SDK/java/org/iotivity/service/ssm/ModelData.java +++ b/service/soft-sensor-manager/SDK/java/org/iotivity/service/ssm/ModelData.java @@ -1,31 +1,100 @@ +/****************************************************************** + * + * Copyright 2015 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ +/** + * @file ModelData.java + * + * @brief This file provides a class for Model data operations + * message + * + */ + package org.iotivity.service.ssm; -public class ModelData { - - private int pIModelDataInstance; - - public ModelData(int iModelDataInstance) - { - pIModelDataInstance = iModelDataInstance; - } - - public int GetDataId() - { - return CoreController.getInstance().GetDataId(pIModelDataInstance); - } - - public int GetPropertyCount() - { - return CoreController.getInstance().GetPropertyCount(pIModelDataInstance); - } - - public String GetPropertyName(int propertyIndex) - { - return CoreController.getInstance().GetPropertyName(pIModelDataInstance, propertyIndex); - } - - public String GetPropertyValue(int propertyIndex) - { - return CoreController.getInstance().GetPropertyValue(pIModelDataInstance, propertyIndex); - } +/** + * @class ModelData + * @brief This class provides a set of API for DataReader class to handle the data + * received by IQueryEngineEvent listeners from SSMCore + * + */ +public class ModelData +{ + + private int pIModelDataInstance; + + public ModelData(int iModelDataInstance) + { + pIModelDataInstance = iModelDataInstance; + } + + /** + * Get the affected DataId. ContextModel has plenty of data so returned data is matched + * from given condition which in this case is the model data object instance + * + * @return int - the affected DataId + * + */ + public int getDataId() + { + return CoreController.getInstance().getDataId(pIModelDataInstance); + } + + /** + * ContextModel has at least one property that contains data \n + * property is described from its specification. + * + * @return int - number of properties + * + */ + public int getPropertyCount() + { + return CoreController.getInstance().getPropertyCount( + pIModelDataInstance); + } + + /** + * Retrieve the name of the property using the given index + * + * @param propertyIndex + * - index of property to read + * + * @return String - property name + * + */ + public String getPropertyName(int propertyIndex) + { + return CoreController.getInstance().getPropertyName( + pIModelDataInstance, propertyIndex); + } + + /** + * Retrieve the value of the property using the given index + * + * @param propertyIndex + * - index of property to read + * + * @return String - property value + * + */ + public String getPropertyValue(int propertyIndex) + { + return CoreController.getInstance().getPropertyValue( + pIModelDataInstance, propertyIndex); + } } \ No newline at end of file