Class ColumnData
java.lang.Object
uk.ac.starlink.table.ColumnData
- Direct Known Subclasses:
ArrayColumn, BlankColumn, ConstantColumn, WrapperColumn
A column which can supply and possibly store cells in array-like storage
as well as supply column metadata.
Note there is nothing in this class which describes the number of
elements it contains (length of the column). Columns are intended to be
managed by tables, and it is the table which should keep track of
this information.
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new ColumnData with no metadata.ColumnData(ColumnInfo colinfo) Constructs a newColumnDatawith metadata supplied by a givenColumnInfoobject.ColumnData(ValueInfo base) PerformsColumnDatainitialisation based on templateValueInfoobject. -
Method Summary
Modifier and TypeMethodDescriptionReturns theColumnInfowhich provides the metadata for this column.booleanIndicates whether this object can store values.abstract ObjectreadValue(long irow) Returns the value stored at a given row in this column.voidsetColumnInfo(ColumnInfo colinfo) Sets theColumnInfowhich provides the metadata for this column.voidstoreValue(long irow, Object val) Stores a given value in a given row for this column.
-
Constructor Details
-
ColumnData
public ColumnData()Constructs a new ColumnData with no metadata. -
ColumnData
Constructs a newColumnDatawith metadata supplied by a givenColumnInfoobject.- Parameters:
colinfo- the column metadata
-
ColumnData
PerformsColumnDatainitialisation based on templateValueInfoobject.- Parameters:
base- template
-
-
Method Details
-
getColumnInfo
Returns theColumnInfowhich provides the metadata for this column.- Returns:
- the column metadata
-
setColumnInfo
Sets theColumnInfowhich provides the metadata for this column.- Parameters:
colinfo- the column metadata
-
readValue
Returns the value stored at a given row in this column.- Parameters:
irow- the row from which to retrieve the value- Returns:
- the value stored at
irow - Throws:
IOException- if there is some problem reading
-
storeValue
Stores a given value in a given row for this column. Will only work if theisWritablemethod returns true. The implementation in theColumnDataclass throws anUnsupportedOperationException.- Parameters:
irow- the row to store it inval- the object to store- Throws:
UnsupportedOperationException- if !isWritable()NullPointerException- ifval==nulland this column is not nullableArrayStoreException- ifvalis not compatible with the content class of this columnIOException- if there is some problem writing
-
isWritable
public boolean isWritable()Indicates whether this object can store values. The implementation in theColumnDataclass returnsfalse- Returns:
- true iff
storeValue(long, Object)can be used
-