org.simantics.databoard.type
Class RecordType

java.lang.Object
  extended by org.simantics.databoard.type.DataType
      extended by org.simantics.databoard.type.RecordType

public class RecordType
extends DataType


Nested Class Summary
 
Nested classes/interfaces inherited from class org.simantics.databoard.type.DataType
DataType.Visitor<T>, DataType.Visitor1
 
Field Summary
 MethodTypeDefinition[] methods
           
 boolean referable
           
static DataType VOID_TYPE
           
 
Constructor Summary
RecordType()
           
RecordType(boolean referable, 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()
           
 Component getComponent(int index)
          Get component by index.
 Component getComponent(java.lang.String fieldName)
          Get component by name.
 java.lang.Integer getComponentIndex(java.lang.String fieldName)
          Get component by name.
 int getComponentIndex2(java.lang.String fieldName)
          Get component by name.
 Component[] getComponents()
           
 DataType getComponentType(int index)
           
 DataType getComponentType(java.lang.String fieldName)
          Get component Datatype by field name
 int hashCode()
           
 boolean isReferable()
           
 boolean isTupleType()
          Return true if the record is a tuple.
 void removeComponent(java.lang.String name)
           
 void setComponents(Component[] components)
           
 
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

VOID_TYPE

public static final DataType VOID_TYPE

referable

public boolean referable

methods

public MethodTypeDefinition[] methods
Constructor Detail

RecordType

public RecordType()

RecordType

public RecordType(boolean referable,
                  Component... components)
Method Detail

isReferable

public boolean isReferable()

setComponents

public void setComponents(Component[] components)

addComponent

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

removeComponent

public void removeComponent(java.lang.String name)

getComponentIndex

public java.lang.Integer getComponentIndex(java.lang.String fieldName)
Get component 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 component by name.

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

getComponentType

public DataType getComponentType(int index)

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

getComponent

public Component getComponent(int index)
Get component by index.

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

getComponents

public Component[] getComponents()

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()

isTupleType

public boolean isTupleType()
Return true if the record is a tuple. Tuple is a record with all components are named as a number, the index number of the field. Empty record is a tuple

Returns:
true if the record type is a tuple.