Package org.yamcs.yarch
Class Tuple
java.lang.Object
org.yamcs.yarch.Tuple
Contains the tuple value (as an array of Columns) together with a pointer to its definition
-
Constructor Summary
ConstructorsConstructorDescriptionTuple()Create a new tuple with no column.Tuple(TupleDefinition tdef) Create a tuple with all the column values set to null.Tuple(TupleDefinition definition, Object[] columns) Tuple(TupleDefinition definition, List<Object> columns) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a BOOLEAN columnvoidAdd a INT columnvoidAdd a LONG columnvoidAdd a STRING columnvoidvoidaddEnumColumn(String colName, String colValue) Add an ENUM columnvoidaddTimestampColumn(String colName, long colValue) Add a TIMESTAMP columnbooleangetBooleanColumn(String colName) Get the value of column as boolean.bytegetByteColumn(String colName) Get the value of column as byte.getColumn(int i) <T> TReturns the value of the column with the given name or null if there is no valuegetColumnDefinition(int i) getColumnDefinition(String colName) intgetColumnIndex(String colName) returns the index of the column with name or -1 if there is no such columnList<?>doublegetDoubleColumn(String colName) Get the value of column as double.intgetIntColumn(String colName) Get the value of column as int.longgetLongColumn(String colName) Get the value of column as long.shortgetShortColumn(String colName) Get the value of column as short.longgetTimestampColumn(String colName) boolean<T> TremoveColumn(String colName) voidvoidvoidsetColumns(List<Object> cols) voidsetDefinition(TupleDefinition definition) intsize()toString()
-
Constructor Details
-
Tuple
public Tuple()Create a new tuple with no column.Can be used by the
addColumn(String, DataType, Object)methods -
Tuple
-
Tuple
-
Tuple
Create a tuple with all the column values set to null.- Parameters:
tdef-
-
-
Method Details
-
setDefinition
-
getDefinition
-
getColumns
-
setColumns
-
setColumn
-
setColumn
-
getColumnIndex
returns the index of the column with name or -1 if there is no such column- Parameters:
colName- - the name of the column- Returns:
- the index of the column with name or -1 if there is no such column
-
getColumn
Returns the value of the column with the given name or null if there is no value -
getLongColumn
Get the value of column as long.Throws exception if the column does not exist or is of different type
- Parameters:
colName-- Returns:
-
getTimestampColumn
-
getBooleanColumn
Get the value of column as boolean.Throws exception if the column does not exist or is of different type
- Parameters:
colName-- Returns:
-
getByteColumn
Get the value of column as byte.Throws exception if the column does not exist or is of different type
- Parameters:
colName-- Returns:
-
getShortColumn
Get the value of column as short.Throws exception if the column does not exist or is of different type
- Parameters:
colName-- Returns:
-
getIntColumn
Get the value of column as int.Throws exception if the column does not exist or is of different type
- Parameters:
colName-- Returns:
-
getDoubleColumn
Get the value of column as double.Throws exception if the column does not exist or is of different type
- Parameters:
colName-- Returns:
-
getColumnDefinition
-
getColumnDefinition
-
hasColumn
-
getColumn
-
addTimestampColumn
Add a TIMESTAMP column- Parameters:
colName-colValue-
-
addColumn
Add a INT column- Parameters:
colName-colValue-
-
addColumn
Add a BOOLEAN column- Parameters:
colName-colValue-
-
addColumn
Add a LONG column- Parameters:
colName-colValue-
-
addColumn
Add a STRING column- Parameters:
colName-colValue-
-
addEnumColumn
Add an ENUM column- Parameters:
colName-colValue-
-
addColumn
-
removeColumn
-
size
public int size()- Returns:
- return the number of columns
-
toString
-