1 /******************************************************************
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 ******************************************************************/
21 * @file ModelData.java
23 * @brief This file provides a class for Model data operations
28 package org.iotivity.service.ssm;
32 * @brief This class provides a set of API for DataReader class to handle the data
33 * received by IQueryEngineEvent listeners from SSMCore
36 public class ModelData
39 private int pIModelDataInstance;
41 public ModelData(int iModelDataInstance)
43 pIModelDataInstance = iModelDataInstance;
48 * @brief Get the affected DataId - ContextModel has plenty of data so the
49 * returned data is matched fom given condition and returned,
50 * which in this case is the model data object instance
52 * @return int - the affected DataId
54 public int GetDataId()
56 return CoreController.getInstance().GetDataId(pIModelDataInstance);
60 * @fn GetPropertyCount
61 * @brief ContextModel has at least one property that contains data \n
62 * the property is described from its specification.
64 * @return int -the property count
66 public int GetPropertyCount()
68 return CoreController.getInstance().GetPropertyCount(
74 * @brief Retrieve the name of the property using the given index value
76 * @param [in] propertyIndex - index of property to read
78 * @return String - the property name
80 public String GetPropertyName(int propertyIndex)
82 return CoreController.getInstance().GetPropertyName(
83 pIModelDataInstance, propertyIndex);
87 * @fn GetPropertyValue
88 * @brief Retrieve the value of the property using the given index value
90 * @param [in] propertyIndex - index of property to read
92 * @return String - the property value
94 public String GetPropertyValue(int propertyIndex)
96 return CoreController.getInstance().GetPropertyValue(
97 pIModelDataInstance, propertyIndex);