Package org.yamcs.yarch
Class TupleDefinition
- java.lang.Object
-
- org.yamcs.yarch.TupleDefinition
-
- All Implemented Interfaces:
Serializable
public class TupleDefinition extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_COLS
-
Constructor Summary
Constructors Constructor Description TupleDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumn(String name, DataType type)voidaddColumn(ColumnDefinition c)TupleDefinitioncopy()ColumnDefinitiongetColumn(int index)ColumnDefinitiongetColumn(String name)Get a column definition by nameList<ColumnDefinition>getColumnDefinitions()intgetColumnIndex(String name)returns the index of the column with name or -1 if there is no such columnStringgetStringDefinition()Returns a string "(col1 type, col2 type2, ....)"StringgetStringDefinition1()Returns a string "col1 type, col2 type2, ...."booleanhasColumn(String name)intsize()StringtoString()
-
-
-
Field Detail
-
MAX_COLS
public static final int MAX_COLS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getColumnDefinitions
public List<ColumnDefinition> getColumnDefinitions()
-
addColumn
public void addColumn(ColumnDefinition c)
-
getColumnIndex
public int getColumnIndex(String name)
returns the index of the column with name or -1 if there is no such column- Parameters:
name-- Returns:
- the index of the column with name or -1 if there is no such column
-
hasColumn
public boolean hasColumn(String name)
-
getColumn
public ColumnDefinition getColumn(String name)
Get a column definition by name- Parameters:
name-- Returns:
- the column definition of the named column or null if the table does not have a column by that name
-
getColumn
public ColumnDefinition getColumn(int index)
-
getStringDefinition
public String getStringDefinition()
Returns a string "(col1 type, col2 type2, ....)" suitable to be used in create stream
-
getStringDefinition1
public String getStringDefinition1()
Returns a string "col1 type, col2 type2, ...." (without parenthesis) suitable to be used in create table
-
size
public int size()
- Returns:
- number of columns part of the tuple
-
copy
public TupleDefinition copy()
- Returns:
- a copy of the tuple definition that can be used to add columns
-
-