public abstract class AbstractStarTable extends java.lang.Object implements StarTable
StarTable interface.
This implementation assumes that random access is not available;
subclasses which provide random access should override
the isRandom, getCell
and perhaps getRow methods.| Constructor and Description |
|---|
AbstractStarTable() |
| Modifier and Type | Method and Description |
|---|---|
static int |
checkedLongToInt(long lval)
Convenience method to get an
int
value from a long. |
void |
close()
The
AbstractStarTable implementation of this method
does nothing. |
java.lang.Object |
getCell(long irow,
int icol)
The
AbstractStarTable implementation of this method
throws an UnsupportedOperationException,
since unless otherwise provided there is no random access. |
java.util.List<ValueInfo> |
getColumnAuxDataInfos()
Goes through the table columns (
ColumnInfo objects)
and picks out all the AuxData items which exist, generalising
where necessary and returning a union of them in
alphabetical order by name. |
abstract int |
getColumnCount()
Returns the number of columns in this table.
|
abstract ColumnInfo |
getColumnInfo(int icol)
Returns the object describing the data in a given column.
|
java.lang.String |
getName()
Returns the name of this table, if it has one.
|
java.util.List<DescribedValue> |
getParameters()
Returns a list of table parameters, that is metadata items
which pertain to the entire table.
|
java.lang.Object[] |
getRow(long irow)
The
AbstractStarTable implementation of this method
constructs a row by repeated invocation of getCell(long, int). |
RowAccess |
getRowAccess()
Returns an object which can provide random access to this
table's data, if random access is implemented.
|
abstract long |
getRowCount()
Returns the number of rows in this table, if known.
|
abstract RowSequence |
getRowSequence()
Returns an object which can iterate over all the rows in the table
sequentially.
|
RowSplittable |
getRowSplittable()
Returns a default splittable which relies on table random access
if available, or otherwise provides only sequential access (no splits).
|
java.net.URL |
getURL()
Returns the URL of this table, if it has one.
|
boolean |
isRandom()
The
AbstractStarTable implementation of this method
returns false. |
void |
setName(java.lang.String name)
Sets the name for this table.
|
void |
setParameters(java.util.List<DescribedValue> parameters)
Sets the list of table parameters, that is items which pertain
to the entire table.
|
void |
setURL(java.net.URL url)
Sets the URL for this table.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetParameterByName, setParameterpublic java.util.List<ValueInfo> getColumnAuxDataInfos()
ColumnInfo objects)
and picks out all the AuxData items which exist, generalising
where necessary and returning a union of them in
alphabetical order by name.
Subclasses should override this if they can do better, for instance
providing an order for the keys.getColumnAuxDataInfos in interface StarTableValueInfo
items which in fact crop up in column metadataDefaultValueInfo.getAuxData()public java.util.List<DescribedValue> getParameters()
StarTablegetParameters in interface StarTableList of DescribedValue objects
constituting table-wide metadata not covered elsewhere
in this interfacepublic void setParameters(java.util.List<DescribedValue> parameters)
parameters should be a DescribedValue object.parameters - a List of DescribedValues pertaining
to this tablepublic java.lang.String getName()
StarTablepublic void setName(java.lang.String name)
public java.net.URL getURL()
StarTablepublic void setURL(java.net.URL url)
public static int checkedLongToInt(long lval)
public boolean isRandom()
AbstractStarTable implementation of this method
returns false.public RowAccess getRowAccess() throws java.io.IOException
StarTablegetRowAccess in interface StarTablejava.io.IOException - if there is an error setting up accesspublic RowSplittable getRowSplittable() throws java.io.IOException
It is often possible to provide a better implementation than this.
getRowSplittable in interface StarTableTables.getDefaultRowSplittable(this)java.io.IOExceptionRowRunnerpublic java.lang.Object getCell(long irow,
int icol)
throws java.io.IOException
AbstractStarTable implementation of this method
throws an UnsupportedOperationException,
since unless otherwise provided there is no random access.public java.lang.Object[] getRow(long irow)
throws java.io.IOException
AbstractStarTable implementation of this method
constructs a row by repeated invocation of getCell(long, int).public void close()
throws java.io.IOException
AbstractStarTable implementation of this method
does nothing.public abstract ColumnInfo getColumnInfo(int icol)
StarTablegetColumnInfo in interface StarTableicol - the column for which header information is requiredicolpublic abstract int getColumnCount()
StarTablegetColumnCount in interface StarTablepublic abstract long getRowCount()
StarTablegetRowCount in interface StarTablepublic abstract RowSequence getRowSequence() throws java.io.IOException
StarTablegetRowSequence in interface StarTablejava.io.IOException - if there is an error providing access