org.simantics.databoard.binding.mutable
Class MutableByteBinding

java.lang.Object
  extended by org.simantics.databoard.binding.Binding
      extended by org.simantics.databoard.binding.NumberBinding
          extended by org.simantics.databoard.binding.ByteBinding
              extended by org.simantics.databoard.binding.mutable.MutableByteBinding
All Implemented Interfaces:
java.util.Comparator<java.lang.Object>

public class MutableByteBinding
extends ByteBinding

Binds java.lang.Byte to MutableByte

Author:
Toni Kalajainen

Nested Class Summary
 
Nested classes/interfaces inherited from class org.simantics.databoard.binding.Binding
Binding.Visitor<T>, Binding.Visitor1
 
Field Summary
static MutableByteBinding INSTANCE
           
 
Constructor Summary
MutableByteBinding()
           
MutableByteBinding(ByteType type)
           
 
Method Summary
 java.lang.Object create(byte value)
           
 java.lang.Object create(java.lang.Byte 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
 byte getValue_(java.lang.Object obj)
           
 java.lang.Byte getValue(java.lang.Object obj)
          Get numeric value of an object
 boolean isInstance(java.lang.Object obj)
           
 void setValue(java.lang.Object obj, byte value)
           
 void setValue(java.lang.Object obj, java.lang.Number value)
           
 
Methods inherited from class org.simantics.databoard.binding.ByteBinding
accept, accept, createUnchecked, createUnchecked, deepCompare, deepHashValue, type
 
Methods inherited from class org.simantics.databoard.binding.NumberBinding
assertInstaceIsValid, createUnchecked, createUnchecked
 
Methods inherited from class org.simantics.databoard.binding.Binding
assertInstaceIsValid, clone, cloneUnchecked, compare, createDefault, createDefaultUnchecked, createRandom, createRandomUnchecked, equals, hashValue, isImmutable, main, parseValue, parseValue, parseValueDefinition, printValue, printValueDefinition, serializer, serializer, serializerUnchecked, 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
 

Field Detail

INSTANCE

public static MutableByteBinding INSTANCE
Constructor Detail

MutableByteBinding

public MutableByteBinding()

MutableByteBinding

public MutableByteBinding(ByteType type)
Method Detail

create

public java.lang.Object create(byte value)
Specified by:
create in class ByteBinding

create

public java.lang.Object create(java.lang.Byte value)
Specified by:
create in class ByteBinding

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 ByteBinding
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 ByteBinding
Returns:
number

getValue_

public byte getValue_(java.lang.Object obj)
               throws BindingException
Specified by:
getValue_ in class ByteBinding
Throws:
BindingException

getValue

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

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

isInstance

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

setValue

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

setValue

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