X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fsimulator%2Fjava%2Feclipse-plugin%2FClientControllerPlugin%2Fsrc%2Foic%2Fsimulator%2Fclientcontroller%2Fremoteresource%2FRemoteResourceAttribute.java;h=0c163414e82853a9b99892547e7bbaad69a89cbb;hb=b76f9709482b03334b468ab47a295761b3fd6a78;hp=27cbdc8391e9adfaa83d7a4b244b15a03dd1954d;hpb=6848338aebbe9c639e4e2bb01065e5ccff34092b;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/simulator/java/eclipse-plugin/ClientControllerPlugin/src/oic/simulator/clientcontroller/remoteresource/RemoteResourceAttribute.java b/service/simulator/java/eclipse-plugin/ClientControllerPlugin/src/oic/simulator/clientcontroller/remoteresource/RemoteResourceAttribute.java index 27cbdc8..0c16341 100644 --- a/service/simulator/java/eclipse-plugin/ClientControllerPlugin/src/oic/simulator/clientcontroller/remoteresource/RemoteResourceAttribute.java +++ b/service/simulator/java/eclipse-plugin/ClientControllerPlugin/src/oic/simulator/clientcontroller/remoteresource/RemoteResourceAttribute.java @@ -21,8 +21,9 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import org.oic.simulator.ResourceAttribute; -import org.oic.simulator.ResourceAttribute.Type; +import org.oic.simulator.AttributeProperty.Type; +import org.oic.simulator.AttributeValue.ValueType; +import org.oic.simulator.SimulatorResourceAttribute; /** * This class represents an attribute in the remote resource. @@ -30,23 +31,27 @@ import org.oic.simulator.ResourceAttribute.Type; public class RemoteResourceAttribute { // Native object reference - private ResourceAttribute resourceAttribute; + private SimulatorResourceAttribute resourceAttributeRef; - private String attributeName; - private Object attributeValue; - private Type attValType; - private Type attValBaseType; - private List allowedValues; + private String attributeName; + private Object attributeValue; - private Object minValue; - private Object maxValue; + private ValueType attValType; + private ValueType attValBaseType; + private int depth; - public ResourceAttribute getResourceAttribute() { - return resourceAttribute; + private Type valuesType; + private List allowedValues; + private Object minValue; + private Object maxValue; + + public SimulatorResourceAttribute getResourceAttributeRef() { + return resourceAttributeRef; } - public void setResourceAttribute(ResourceAttribute resourceAttribute) { - this.resourceAttribute = resourceAttribute; + public void setResourceAttributeRef( + SimulatorResourceAttribute resourceAttribute) { + this.resourceAttributeRef = resourceAttribute; } public String getAttributeName() { @@ -112,7 +117,7 @@ public class RemoteResourceAttribute { clone.setAttValType(attribute.getAttValType()); clone.setMinValue(attribute.getMinValue()); clone.setMaxValue(attribute.getMaxValue()); - clone.setResourceAttribute(null); + clone.setResourceAttributeRef(null); } return clone; } @@ -132,18 +137,10 @@ public class RemoteResourceAttribute { } } } else if (null != minValue && null != maxValue) { - if (attributeValue.getClass() == Integer.class) { - int min = (Integer) minValue; - int max = (Integer) maxValue; - for (int value = min; value <= max; value++) { - valueList.add(String.valueOf(value)); - } - } else if (attributeValue.getClass() == Double.class) { - double min = (Double) minValue; - double max = (Double) maxValue; - for (double value = min; value <= max; value++) { - valueList.add(String.valueOf(value)); - } + double min = (Double) minValue; + double max = (Double) maxValue; + for (double value = min; value <= max; value++) { + valueList.add(String.valueOf(value)); } } if (valueList.size() < 1 && null != attributeValue) { @@ -152,6 +149,7 @@ public class RemoteResourceAttribute { return valueList; } + // Method added for debugging purpose public static void printAttributes( Map attributeMap) { Iterator itr = attributeMap.keySet().iterator(); @@ -167,19 +165,35 @@ public class RemoteResourceAttribute { } } - public Type getAttValType() { + public ValueType getAttValType() { return attValType; } - public void setAttValType(Type attValType) { + public void setAttValType(ValueType attValType) { this.attValType = attValType; } - public Type getAttValBaseType() { + public ValueType getAttValBaseType() { return attValBaseType; } - public void setAttValBaseType(Type attValBaseType) { + public void setAttValBaseType(ValueType attValBaseType) { this.attValBaseType = attValBaseType; } + + public Type getValuesType() { + return valuesType; + } + + public void setValuesType(Type valuesType) { + this.valuesType = valuesType; + } + + public int getDepth() { + return depth; + } + + public void setDepth(int depth) { + this.depth = depth; + } } \ No newline at end of file