org.simantics.databoard.type
Class RecordType
java.lang.Object
org.simantics.databoard.type.DataType
org.simantics.databoard.type.RecordType
public class RecordType
- extends DataType
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
VOID_TYPE
public static final DataType VOID_TYPE
referable
public boolean referable
methods
public MethodTypeDefinition[] methods
RecordType
public RecordType()
RecordType
public RecordType(boolean referable,
Component... components)
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.