Class Tuple

java.lang.Object
org.yamcs.yarch.Tuple

public class Tuple extends Object
Contains the tuple value (as an array of Columns) together with a pointer to its definition
  • Constructor Details

  • Method Details

    • setDefinition

      public void setDefinition(TupleDefinition definition)
    • getDefinition

      public TupleDefinition getDefinition()
    • getColumns

      public List<?> getColumns()
    • setColumns

      public void setColumns(List<Object> cols)
    • setColumn

      public void setColumn(int index, Object value)
    • setColumn

      public void setColumn(String colName, Object value)
    • getColumnIndex

      public int getColumnIndex(String colName)
      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

      public <T> T getColumn(String colName)
    • getLongColumn

      public long getLongColumn(String colName)
      Get the value of column as long.

      Throws exception if the column does not exist or is of different type

      Parameters:
      colName -
      Returns:
    • getTimestampColumn

      public long getTimestampColumn(String colName)
    • getBooleanColumn

      public boolean getBooleanColumn(String colName)
      Get the value of column as boolean.

      Throws exception if the column does not exist or is of different type

      Parameters:
      colName -
      Returns:
    • getByteColumn

      public byte getByteColumn(String colName)
      Get the value of column as byte.

      Throws exception if the column does not exist or is of different type

      Parameters:
      colName -
      Returns:
    • getShortColumn

      public short getShortColumn(String colName)
      Get the value of column as short.

      Throws exception if the column does not exist or is of different type

      Parameters:
      colName -
      Returns:
    • getIntColumn

      public int getIntColumn(String colName)
      Get the value of column as int.

      Throws exception if the column does not exist or is of different type

      Parameters:
      colName -
      Returns:
    • getDoubleColumn

      public double getDoubleColumn(String colName)
      Get the value of column as double.

      Throws exception if the column does not exist or is of different type

      Parameters:
      colName -
      Returns:
    • getColumnDefinition

      public ColumnDefinition getColumnDefinition(String colName)
    • getColumnDefinition

      public ColumnDefinition getColumnDefinition(int i)
    • hasColumn

      public boolean hasColumn(String colName)
    • getColumn

      public Object getColumn(int i)
    • addTimestampColumn

      public void addTimestampColumn(String colName, long colValue)
      Add a TIMESTAMP column
      Parameters:
      colName -
      colValue -
    • addColumn

      public void addColumn(String colName, int colValue)
      Add a INT column
      Parameters:
      colName -
      colValue -
    • addColumn

      public void addColumn(String colName, boolean colValue)
      Add a BOOLEAN column
      Parameters:
      colName -
      colValue -
    • addColumn

      public void addColumn(String colName, long colValue)
      Add a LONG column
      Parameters:
      colName -
      colValue -
    • addColumn

      public void addColumn(String colName, String colValue)
      Add a STRING column
      Parameters:
      colName -
      colValue -
    • addEnumColumn

      public void addEnumColumn(String colName, String colValue)
      Add an ENUM column
      Parameters:
      colName -
      colValue -
    • addColumn

      public void addColumn(String colName, DataType type, Object colValue)
    • removeColumn

      public <T> T removeColumn(String colName)
    • size

      public int size()
      Returns:
      return the number of columns
    • toString

      public String toString()
      Overrides:
      toString in class Object