Package uk.ac.starlink.table
Class EditableColumn
- java.lang.Object
-
- uk.ac.starlink.table.ColumnData
-
- uk.ac.starlink.table.WrapperColumn
-
- uk.ac.starlink.table.EditableColumn
-
public class EditableColumn extends WrapperColumn
A column which can be initialised from a given existing column, but whose cells can be written to. Whether the initialisation is done by copying the whole lot and creating a new column or by just keeping track of the changed elements is unspecified and down to the implementation. Modifications to the cell data or the metadata of this column will not affect the data/metadata of the base column.- Author:
- Mark Taylor (Starlink)
-
-
Constructor Summary
Constructors Constructor Description EditableColumn(ColumnData base)
Constructs a new EditableColumn based on an existing column.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isWritable()
Returns true.java.lang.Object
readValue(long irow)
Returns the value stored at a given row in this column.void
storeValue(long irow, java.lang.Object value)
Stores a given value in a given row for this column.-
Methods inherited from class uk.ac.starlink.table.WrapperColumn
getBaseColumn
-
Methods inherited from class uk.ac.starlink.table.ColumnData
getColumnInfo, setColumnInfo
-
-
-
-
Constructor Detail
-
EditableColumn
public EditableColumn(ColumnData base)
Constructs a new EditableColumn based on an existing column.
-
-
Method Detail
-
isWritable
public boolean isWritable()
Returns true.- Overrides:
isWritable
in classWrapperColumn
- Returns:
- whether cells can be edited. They can.
-
readValue
public java.lang.Object readValue(long irow) throws java.io.IOException
Description copied from class:ColumnData
Returns the value stored at a given row in this column.- Overrides:
readValue
in classWrapperColumn
- Parameters:
irow
- the row from which to retrieve the value- Returns:
- the value stored at irow
- Throws:
java.io.IOException
- if there is some problem reading
-
storeValue
public void storeValue(long irow, java.lang.Object value) throws java.io.IOException
Description copied from class:ColumnData
Stores a given value in a given row for this column. Will only work if the isWritable method returns true. The implementation in the ColumnData class throws an UnsupportedOperationException.- Overrides:
storeValue
in classWrapperColumn
- Parameters:
irow
- the row to store it invalue
- the object to store- Throws:
java.io.IOException
- if there is some problem writing
-
-