org.simantics.databoard.binding
Class BooleanBinding

java.lang.Object
  extended by org.simantics.databoard.binding.Binding
      extended by org.simantics.databoard.binding.BooleanBinding
All Implemented Interfaces:
java.util.Comparator<java.lang.Object>
Direct Known Subclasses:
BooleanBindingDefault, MutableBooleanBinding

public abstract class BooleanBinding
extends Binding

This is a binding of Boolean Type and a Java Object.

Author:
Toni Kalajainen
See Also:
BooleanBindingDefault, MutableBooleanBinding, BooleanType

Nested Class Summary
 
Nested classes/interfaces inherited from class org.simantics.databoard.binding.Binding
Binding.Visitor<T>, Binding.Visitor1
 
Constructor Summary
BooleanBinding(BooleanType type)
           
 
Method Summary
<T> T
accept(Binding.Visitor<T> v)
           
 void accept(Binding.Visitor1 v, java.lang.Object obj)
           
 void assertInstaceIsValid(java.lang.Object obj, java.util.Set<java.lang.Object> validInstances)
          Assert the obj is valid data type
abstract  java.lang.Object create(boolean value)
           
abstract  java.lang.Object create(java.lang.Boolean value)
           
 java.lang.Object createUnchecked(java.lang.Boolean value)
           
 int deepCompare(java.lang.Object o1, java.lang.Object o2, java.util.Set<IdentityPair<java.lang.Object,java.lang.Object>> compareHistory)
           
 int deepHashValue(java.lang.Object value, java.util.IdentityHashMap<java.lang.Object,java.lang.Object> hashedObjects)
          Calculate hash value
 Binding getComponentBinding(ChildReference path)
          Get component binding
 Binding getComponentBinding(int index)
          Get component binding
 int getComponentCount()
          Get component binding count
abstract  boolean getValue_(java.lang.Object o)
           
abstract  java.lang.Boolean getValue(java.lang.Object o)
           
 void readFrom(Binding srcBinding, java.lang.Object src, java.lang.Object dst)
          Read values from another object.
abstract  void setValue(java.lang.Object obj, boolean newValue)
           
abstract  void setValue(java.lang.Object obj, java.lang.Boolean newValue)
           
 BooleanType type()
          Get Value Type
 
Methods inherited from class org.simantics.databoard.binding.Binding
assertInstaceIsValid, clone, cloneUnchecked, compare, createDefault, createDefaultUnchecked, createRandom, createRandomUnchecked, equals, hashValue, isImmutable, isInstance, 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

BooleanBinding

public BooleanBinding(BooleanType type)
Method Detail

create

public abstract java.lang.Object create(boolean value)
                                 throws BindingException
Throws:
BindingException

create

public abstract java.lang.Object create(java.lang.Boolean value)
                                 throws BindingException
Throws:
BindingException

setValue

public abstract void setValue(java.lang.Object obj,
                              java.lang.Boolean newValue)
                       throws BindingException
Throws:
BindingException

setValue

public abstract void setValue(java.lang.Object obj,
                              boolean newValue)
                       throws BindingException
Throws:
BindingException

getValue

public abstract java.lang.Boolean getValue(java.lang.Object o)
                                    throws BindingException
Throws:
BindingException

getValue_

public abstract boolean getValue_(java.lang.Object o)
                           throws BindingException
Throws:
BindingException

createUnchecked

public java.lang.Object createUnchecked(java.lang.Boolean value)
                                 throws RuntimeBindingException
Throws:
RuntimeBindingException

readFrom

public void readFrom(Binding srcBinding,
                     java.lang.Object src,
                     java.lang.Object dst)
              throws BindingException
Description copied from class: Binding
Read values from another object.

Specified by:
readFrom in class Binding
dst - valid object of this binding
Throws:
BindingException

type

public BooleanType type()
Description copied from class: Binding
Get Value Type

Overrides:
type in class Binding
Returns:
value type

accept

public void accept(Binding.Visitor1 v,
                   java.lang.Object obj)
Specified by:
accept in class Binding

accept

public <T> T accept(Binding.Visitor<T> v)
Specified by:
accept in class Binding

assertInstaceIsValid

public void assertInstaceIsValid(java.lang.Object obj,
                                 java.util.Set<java.lang.Object> validInstances)
                          throws BindingException
Description copied from class: Binding
Assert the obj is valid data type

Specified by:
assertInstaceIsValid in class Binding
Parameters:
obj - the instance
validInstances - optional set of already validated instances
Throws:
BindingException - on invalid instance

deepHashValue

public int deepHashValue(java.lang.Object value,
                         java.util.IdentityHashMap<java.lang.Object,java.lang.Object> hashedObjects)
                  throws BindingException
Description copied from class: Binding
Calculate hash value

Specified by:
deepHashValue in class Binding
hashedObjects - collection of already hashed object or optionally null
Returns:
hash value
Throws:
BindingException

deepCompare

public int deepCompare(java.lang.Object o1,
                       java.lang.Object o2,
                       java.util.Set<IdentityPair<java.lang.Object,java.lang.Object>> compareHistory)
                throws BindingException
Specified by:
deepCompare in class Binding
Throws:
BindingException

getComponentBinding

public Binding getComponentBinding(ChildReference path)
Description copied from class: Binding
Get component binding

Specified by:
getComponentBinding in class Binding
Parameters:
path - child path or null to return this.
Returns:
binding

getComponentCount

public int getComponentCount()
Description copied from class: Binding
Get component binding count

Specified by:
getComponentCount in class Binding
Returns:
component count

getComponentBinding

public Binding getComponentBinding(int index)
Description copied from class: Binding
Get component binding

Specified by:
getComponentBinding in class Binding
Returns:
binding