org.simantics.databoard.binding.impl
Class DoubleBindingDefault

java.lang.Object
  extended by org.simantics.databoard.binding.Binding
      extended by org.simantics.databoard.binding.NumberBinding
          extended by org.simantics.databoard.binding.DoubleBinding
              extended by org.simantics.databoard.binding.impl.DoubleBindingDefault
All Implemented Interfaces:
java.util.Comparator<java.lang.Object>

public class DoubleBindingDefault
extends DoubleBinding

Binds DoubleType to java.lang.Double

Author:
Toni Kalajainen

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
 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, readFrom
 
Methods inherited from class org.simantics.databoard.binding.Binding
assertInstaceIsValid, clone, cloneUnchecked, compare, createDefault, createDefaultUnchecked, createRandom, createRandomUnchecked, equals, hashValue, parseValue, parseValue, parseValueDefinition, printValue, printValueDefinition, serializer, 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

DoubleBindingDefault

public DoubleBindingDefault(DoubleType type)
Method Detail

type

public DoubleType type()
Description copied from class: NumberBinding
Get Data type

Overrides:
type in class DoubleBinding
Returns:
data type

create

public java.lang.Object create(java.lang.Double value)
Specified by:
create in class DoubleBinding

create

public java.lang.Object create(double value)
Specified by:
create in class DoubleBinding

create

public java.lang.Object create(java.lang.Number value)
Description copied from class: NumberBinding
Create value by converting it from any Number instance to a Number instance of this Binding type. NOTE WARNING! Using this method may lose precision or value in the conversion. E.g. Double to Integer, or Long to Byte

Specified by:
create in class DoubleBinding
Returns:
the value in the format of the binding type

create

public java.lang.Object create(java.lang.String value)
Description copied from class: NumberBinding
Creates a value from its string representation

Specified by:
create in class DoubleBinding
Returns:
number

getValue

public java.lang.Double getValue(java.lang.Object o)
                          throws BindingException
Description copied from class: NumberBinding
Get numeric value of an object

Specified by:
getValue in class DoubleBinding
Parameters:
o - object
Returns:
Number
Throws:
BindingException - thrown if obj is incorrect class

getValue_

public double getValue_(java.lang.Object o)
                 throws BindingException
Specified by:
getValue_ in class DoubleBinding
Throws:
BindingException

setValue

public void setValue(java.lang.Object obj,
                     java.lang.Number value)
              throws BindingException
Specified by:
setValue in class DoubleBinding
Throws:
BindingException

setValue

public void setValue(java.lang.Object obj,
                     double value)
              throws BindingException
Specified by:
setValue in class DoubleBinding
Throws:
BindingException

isInstance

public boolean isInstance(java.lang.Object obj)
Specified by:
isInstance in class DoubleBinding

isImmutable

public boolean isImmutable()
Description copied from class: Binding
Return true if the value is immutable. This question excludes the immutability of the component types.

Overrides:
isImmutable in class Binding
Returns:
true value if immutable