org.simantics.databoard.type
Class UnionType

java.lang.Object
  extended by org.simantics.databoard.type.Datatype
      extended by org.simantics.databoard.type.UnionType

public class UnionType
extends Datatype


Nested Class Summary
 
Nested classes/interfaces inherited from class org.simantics.databoard.type.Datatype
Datatype.Visitor<T>, Datatype.Visitor1
 
Field Summary
 Component[] components
           
 
Constructor Summary
UnionType()
           
UnionType(Component... components)
           
 
Method Summary
<T> T
accept(Datatype.Visitor<T> v)
           
 void accept(Datatype.Visitor1 v, java.lang.Object obj)
           
 void addComponent(java.lang.String name, Datatype type)
           
 int count()
          Get component type count
 Component getComponent(int i)
           
 Component getComponent(java.lang.String fieldName)
          Get component by name.
 java.lang.Integer getComponentIndex(java.lang.String fieldName)
          Get tag by name.
 int getComponentIndex2(java.lang.String fieldName)
          Get tag by name.
 Component[] getComponents()
           
 Datatype getComponentType(ChildReference path)
          Get component type
 Datatype getComponentType(int index)
          Get component type
 Datatype getComponentType(java.lang.String fieldName)
          Get component Datatype by field name
 int hashCode()
           
 void removeComponent(java.lang.String tagName)
           
 
Methods inherited from class org.simantics.databoard.type.Datatype
equals, toSingleLineString, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

components

public Component[] components
Constructor Detail

UnionType

public UnionType()

UnionType

public UnionType(Component... components)
Method Detail

addComponent

public void addComponent(java.lang.String name,
                         Datatype type)

removeComponent

public void removeComponent(java.lang.String tagName)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

accept

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

accept

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

count

public int count()
Description copied from class: Datatype
Get component type count

Specified by:
count in class Datatype
Returns:
component count

getComponentType

public Datatype getComponentType(ChildReference path)
Description copied from class: Datatype
Get component type

Specified by:
getComponentType in class Datatype
Parameters:
path - child path or null to return this.
Returns:
datatype

getComponent

public Component getComponent(int i)

getComponents

public Component[] getComponents()

getComponentIndex

public java.lang.Integer getComponentIndex(java.lang.String fieldName)
Get tag by name.

Parameters:
fieldName - component name
Returns:
component index or null if one does not exist

getComponentIndex2

public int getComponentIndex2(java.lang.String fieldName)
Get tag by name.

Parameters:
fieldName - component name
Returns:
component index or -1 if one does not exist

getComponentType

public Datatype getComponentType(java.lang.String fieldName)
Get component Datatype by field name

Parameters:
fieldName -
Returns:
datatype or null

getComponent

public Component getComponent(java.lang.String fieldName)
Get component by name.

Parameters:
fieldName - component name
Returns:
component or null if one does not exist

getComponentType

public Datatype getComponentType(int index)
Description copied from class: Datatype
Get component type

Specified by:
getComponentType in class Datatype
Parameters:
index - component index
Returns:
datatype