|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simantics.databoard.binding.Binding
org.simantics.databoard.binding.NumberBinding
org.simantics.databoard.binding.DoubleBinding
org.simantics.databoard.binding.impl.DoubleBindingDefault
public class DoubleBindingDefault
Binds DoubleType to java.lang.Double
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.simantics.databoard.binding.Binding |
---|
Binding.Visitor<T>, Binding.Visitor1 |
Constructor Summary | |
---|---|
DoubleBindingDefault(DoubleType type)
|
Method Summary | |
---|---|
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares its two data values for order. |
java.lang.Object |
create(double value)
|
java.lang.Object |
create(java.lang.Double value)
|
java.lang.Object |
create(java.lang.Number value)
Create value by converting it from any Number instance to a Number instance of this Binding type. |
java.lang.Object |
create(java.lang.String value)
Creates a value from its string representation |
double |
getValue_(java.lang.Object o)
|
java.lang.Double |
getValue(java.lang.Object o)
Get numeric value of an object |
boolean |
isImmutable()
Return true if the value is immutable. |
boolean |
isInstance(java.lang.Object obj)
|
void |
setValue(java.lang.Object obj,
double value)
|
void |
setValue(java.lang.Object obj,
java.lang.Number value)
|
DoubleType |
type()
Get Data type |
Methods inherited from class org.simantics.databoard.binding.DoubleBinding |
---|
accept, accept, createUnchecked, createUnchecked, deepCompare, deepHashValue |
Methods inherited from class org.simantics.databoard.binding.NumberBinding |
---|
assertInstaceIsValid, createUnchecked, createUnchecked, getComponentBinding, getComponentBinding, getComponentCount, readFrom |
Methods inherited from class org.simantics.databoard.binding.Binding |
---|
assertInstaceIsValid, clone, cloneUnchecked, createDefault, createDefaultUnchecked, createRandom, createRandom, createRandom, createRandomUnchecked, equals, hashValue, parseValue, parseValue, parseValueDefinition, printValue, printValueDefinition, readFromTry, readFromTryUnchecked, readFromUnchecked, serializer, toString, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
---|
equals |
Constructor Detail |
---|
public DoubleBindingDefault(DoubleType type)
Method Detail |
---|
public DoubleType type()
NumberBinding
type
in class DoubleBinding
public java.lang.Object create(java.lang.Double value)
create
in class DoubleBinding
public java.lang.Object create(double value)
create
in class DoubleBinding
public java.lang.Object create(java.lang.Number value)
NumberBinding
create
in class DoubleBinding
public java.lang.Object create(java.lang.String value)
NumberBinding
create
in class DoubleBinding
public java.lang.Double getValue(java.lang.Object o) throws BindingException
NumberBinding
getValue
in class DoubleBinding
o
- object
BindingException
- thrown if obj is incorrect classpublic double getValue_(java.lang.Object o) throws BindingException
getValue_
in class DoubleBinding
BindingException
public void setValue(java.lang.Object obj, java.lang.Number value) throws BindingException
setValue
in class DoubleBinding
BindingException
public void setValue(java.lang.Object obj, double value) throws BindingException
setValue
in class DoubleBinding
BindingException
public boolean isInstance(java.lang.Object obj)
isInstance
in class DoubleBinding
public boolean isImmutable()
Binding
isImmutable
in class Binding
true
value if immutablepublic int compare(java.lang.Object o1, java.lang.Object o2)
Binding
The implementor must also ensure that the relation is transitive:
((compare(x, y)>0) && (compare(y, z)>0))
implies
compare(x, z)>0
.
Finally, the implementor must ensure that compare(x, y)==0
implies that sgn(compare(x, z))==sgn(compare(y, z))
for all
z
.
The comparison function is defined at http://dev.simantics.org/index.php/Org.simantics.databoard_Manual#CompareTo_and_Equals
Note, comparing 2 different number types will not result a value comparison. Instead values have the following type precedence ByteType, IntegerType, LongType, FloatType, and the highest DoubleType.
compare
in interface java.util.Comparator<java.lang.Object>
compare
in class Binding
o1
- the first object to be compared.o2
- the second object to be compared.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |