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
ConstructorDescriptionTuple()
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 TypeMethodDescriptionvoid
Add a BOOLEAN columnvoid
Add a INT columnvoid
Add a LONG columnvoid
Add a STRING columnvoid
void
addEnumColumn
(String colName, String colValue) Add an ENUM columnvoid
addTimestampColumn
(String colName, long colValue) Add a TIMESTAMP columnboolean
getBooleanColumn
(String colName) Get the value of column as boolean.byte
getByteColumn
(String colName) Get the value of column as byte.getColumn
(int i) <T> T
getColumnDefinition
(int i) getColumnDefinition
(String colName) int
getColumnIndex
(String colName) returns the index of the column with name or -1 if there is no such columnList<?>
double
getDoubleColumn
(String colName) Get the value of column as double.int
getIntColumn
(String colName) Get the value of column as int.long
getLongColumn
(String colName) Get the value of column as long.short
getShortColumn
(String colName) Get the value of column as short.long
getTimestampColumn
(String colName) boolean
<T> T
removeColumn
(String colName) void
void
void
setColumns
(List<Object> cols) void
setDefinition
(TupleDefinition definition) int
size()
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
-
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
-