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;
47 * Get the affected DataId. ContextModel has plenty of data so returned data is matched
48 * from given condition which in this case is the model data object instance
50 * @return int - the affected DataId
53 public int GetDataId()
55 return CoreController.getInstance().GetDataId(pIModelDataInstance);
59 * ContextModel has at least one property that contains data \n
60 * property is described from its specification.
62 * @return int - number of properties
65 public int GetPropertyCount()
67 return CoreController.getInstance().GetPropertyCount(
72 * Retrieve the name of the property using the given index
74 * @param propertyIndex
75 * - index of property to read
77 * @return String - property name
80 public String GetPropertyName(int propertyIndex)
82 return CoreController.getInstance().GetPropertyName(
83 pIModelDataInstance, propertyIndex);
87 * Retrieve the value of the property using the given index
89 * @param propertyIndex
90 * - index of property to read
92 * @return String - property value
95 public String GetPropertyValue(int propertyIndex)
97 return CoreController.getInstance().GetPropertyValue(
98 pIModelDataInstance, propertyIndex);