Class TupleDefinition

java.lang.Object
org.yamcs.yarch.TupleDefinition

public class TupleDefinition extends Object
  • Field Details

  • Constructor Details

    • TupleDefinition

      public TupleDefinition()
  • Method Details

    • getColumnDefinitions

      public List<ColumnDefinition> getColumnDefinitions()
    • addColumn

      public void addColumn(String name, DataType type)
    • addColumn

      public void addColumn(ColumnDefinition c)
    • removeColumn

      public int removeColumn(String name)
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object