Class MetaColumn

java.lang.Object
uk.ac.starlink.topcat.MetaColumn

public abstract class MetaColumn extends Object
This class describes columns in a table of metadata. Such columns may be editable, have names, etc.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    MetaColumn(String name, Class<?> clazz)
    Constructs a new MetaColumn with a given name and content class.
    MetaColumn(String name, Class<?> clazz, String description)
    Constructs a new MetaColumn with a given name, content class and description.
    MetaColumn(uk.ac.starlink.table.ColumnInfo info)
    Constructs a new MetaColumn with a given metadata object.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the class of which all entries in this column are members.
    uk.ac.starlink.table.ColumnInfo
    Returns the metadata object describing this column.
    Returns the name of this column.
    abstract Object
    getValue(int irow)
    Returns the entry at a given row in this column.
    boolean
    isEditable(int irow)
    Indicates whether the entry at a given row in this column can be edited (whether setValue(int, java.lang.Object) may be called on irow).
    void
    setValue(int irow, Object value)
    Sets the value of the entry in this column at a given row.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MetaColumn

      public MetaColumn(String name, Class<?> clazz)
      Constructs a new MetaColumn with a given name and content class.
      Parameters:
      name - the name of the column
      clazz - the Class of which every entry in this column will be a member
    • MetaColumn

      public MetaColumn(String name, Class<?> clazz, String description)
      Constructs a new MetaColumn with a given name, content class and description.
      Parameters:
      name - the name of the column
      clazz - the Class of which every entry in this column will be a member
      description - short textual description of column
    • MetaColumn

      public MetaColumn(uk.ac.starlink.table.ColumnInfo info)
      Constructs a new MetaColumn with a given metadata object.
      Parameters:
      info - column metadata
  • Method Details

    • getValue

      public abstract Object getValue(int irow)
      Returns the entry at a given row in this column.
      Parameters:
      irow - the row for which this column is being queried
    • isEditable

      public boolean isEditable(int irow)
      Indicates whether the entry at a given row in this column can be edited (whether setValue(int, java.lang.Object) may be called on irow). This class's implementation returns false, but it may be overridden by subclasses which permit cell modification.
      Parameters:
      irow - the row for which this column is being queried
      Returns:
      whether the entry at irow may be written to
    • setValue

      public void setValue(int irow, Object value)
      Sets the value of the entry in this column at a given row. This should only be called if isEditable(int)(irow) returns true.
      Parameters:
      irow - the row whose value in this column is to be set
      value - the new value of the entry at irow
    • getName

      public String getName()
      Returns the name of this column.
      Returns:
      name
    • getContentClass

      public Class<?> getContentClass()
      Returns the class of which all entries in this column are members.
      Returns:
      content class
    • getInfo

      public uk.ac.starlink.table.ColumnInfo getInfo()
      Returns the metadata object describing this column.
      Returns:
      column metadata