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.


Constructor Summary
EditableColumn(ColumnData base)
          Constructs a new EditableColumn based on an existing column.
 
Method Summary
 boolean isWritable()
          Returns true.
 Object readValue(long irow)
          Returns the value stored at a given row in this column.
 void storeValue(long irow, Object value)
          Stores a given value in a given row for this column.
 
Methods inherited from class uk.ac.starlink.table.ColumnData
getColumnInfo, setColumnInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 class WrapperColumn
Returns:
whether cells can be edited. They can.

readValue

public Object readValue(long irow)
                 throws IOException
Description copied from class: ColumnData
Returns the value stored at a given row in this column.

Overrides:
readValue in class WrapperColumn
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

public void storeValue(long irow,
                       Object value)
                throws 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 class WrapperColumn
Parameters:
value - the object to store
irow - the row to store it in
Throws:
IOException - if there is some problem writing

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.