[SSM] Add Java SDK comments and fix formatting
[platform/upstream/iotivity.git] / service / soft-sensor-manager / SDK / java / org / iotivity / service / ssm / ModelData.java
1 /******************************************************************
2  *
3  * Copyright 2015 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  ******************************************************************/
20 /**
21  * @file    ModelData.java
22  *
23  * @brief    This file provides a class for Model data operations
24  * message
25  *
26  */
27
28 package org.iotivity.service.ssm;
29
30 /**
31   * @class    ModelData
32   * @brief    This class provides a set of API for DataReader class to handle the data
33   *         received by IQueryEngineEvent listeners from SSMCore
34   *
35   */
36 public class ModelData
37 {
38
39         private int pIModelDataInstance;
40
41         public ModelData(int iModelDataInstance)
42         {
43             pIModelDataInstance = iModelDataInstance;
44         }
45
46         /**
47             * @fn     GetDataId
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
51             *
52             * @return int - the affected DataId
53             */
54         public int GetDataId()
55         {
56             return CoreController.getInstance().GetDataId(pIModelDataInstance);
57         }
58
59         /**
60             * @fn     GetPropertyCount
61             * @brief ContextModel has at least one property that contains data \n
62             *         the property is described from its specification.
63             *
64             * @return int -the property count
65             */
66         public int GetPropertyCount()
67         {
68             return CoreController.getInstance().GetPropertyCount(
69                        pIModelDataInstance);
70         }
71
72         /**
73             * @fn     GetPropertyName
74             * @brief Retrieve the name of the property using the given index value
75             *
76             * @param [in] propertyIndex - index of property to read
77             *
78             * @return String - the property name
79             */
80         public String GetPropertyName(int propertyIndex)
81         {
82             return CoreController.getInstance().GetPropertyName(
83                        pIModelDataInstance, propertyIndex);
84         }
85
86         /**
87             * @fn     GetPropertyValue
88             * @brief Retrieve the value of the property using the given index value
89             *
90             * @param [in] propertyIndex - index of property to read
91             *
92             * @return String - the property value
93             */
94         public String GetPropertyValue(int propertyIndex)
95         {
96             return CoreController.getInstance().GetPropertyValue(
97                        pIModelDataInstance, propertyIndex);
98         }
99 }