Package uk.ac.starlink.topcat
Class MetaColumn
java.lang.Object
uk.ac.starlink.topcat.MetaColumn
This class describes columns in a table of metadata. Such columns
may be editable, have names, etc.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMetaColumn
(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 TypeMethodDescriptionClass
<?> Returns the class of which all entries in this column are members.uk.ac.starlink.table.ColumnInfo
getInfo()
Returns the metadata object describing this column.getName()
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 (whethersetValue(int, java.lang.Object)
may be called onirow
).void
Sets the value of the entry in this column at a given row.
-
Constructor Details
-
MetaColumn
Constructs a new MetaColumn with a given name and content class.- Parameters:
name
- the name of the columnclazz
- the Class of which every entry in this column will be a member
-
MetaColumn
Constructs a new MetaColumn with a given name, content class and description.- Parameters:
name
- the name of the columnclazz
- the Class of which every entry in this column will be a memberdescription
- 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
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 (whethersetValue(int, java.lang.Object)
may be called onirow
). This class's implementation returnsfalse
, 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
Sets the value of the entry in this column at a given row. This should only be called ifisEditable(int)
(irow) returns true.- Parameters:
irow
- the row whose value in this column is to be setvalue
- the new value of the entry atirow
-
getName
Returns the name of this column.- Returns:
- name
-
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
-