public abstract class AbstractStarTable extends 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. |
Object |
getCell(long irow,
int icol)
The
AbstractStarTable implementation of this method
throws an UnsupportedOperationException ,
since unless otherwise provided there is no random access. |
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.
|
String |
getName()
Returns the name of this table, if it has one.
|
List<DescribedValue> |
getParameters()
Returns a list of table parameters, that is metadata items
which pertain to the entire table.
|
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).
|
URL |
getURL()
Returns the URL of this table, if it has one.
|
boolean |
isRandom()
The
AbstractStarTable implementation of this method
returns false . |
void |
setName(String name)
Sets the name for this table.
|
void |
setParameters(List<DescribedValue> parameters)
Sets the list of table parameters, that is items which pertain
to the entire table.
|
void |
setURL(URL url)
Sets the URL for this table.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParameterByName, setParameter
public 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 StarTable
ValueInfo
items which in fact crop up in column metadataDefaultValueInfo.getAuxData()
public List<DescribedValue> getParameters()
StarTable
getParameters
in interface StarTable
List
of DescribedValue
objects
constituting table-wide metadata not covered elsewhere
in this interfacepublic void setParameters(List<DescribedValue> parameters)
parameters
should be a DescribedValue
object.parameters
- a List of DescribedValue
s pertaining
to this tablepublic String getName()
StarTable
public void setName(String name)
public URL getURL()
StarTable
public void setURL(URL url)
public static int checkedLongToInt(long lval)
public boolean isRandom()
AbstractStarTable
implementation of this method
returns false
.public RowAccess getRowAccess() throws IOException
StarTable
getRowAccess
in interface StarTable
IOException
- if there is an error setting up accesspublic RowSplittable getRowSplittable() throws IOException
It is often possible to provide a better implementation than this.
getRowSplittable
in interface StarTable
Tables.getDefaultRowSplittable(this)
IOException
RowRunner
public Object getCell(long irow, int icol) throws IOException
AbstractStarTable
implementation of this method
throws an UnsupportedOperationException
,
since unless otherwise provided there is no random access.getCell
in interface StarTable
irow
- the index of the cell's rowicol
- the index of the cell's columnIOException
- if there is an error reading the datapublic Object[] getRow(long irow) throws IOException
AbstractStarTable
implementation of this method
constructs a row by repeated invocation of getCell(long, int)
.getRow
in interface StarTable
irow
- the index of the row to retrieveirow
IOException
- if there is an error reading the datapublic void close() throws IOException
AbstractStarTable
implementation of this method
does nothing.close
in interface Closeable
close
in interface AutoCloseable
close
in interface StarTable
IOException
public abstract ColumnInfo getColumnInfo(int icol)
StarTable
getColumnInfo
in interface StarTable
icol
- the column for which header information is requiredicol
public abstract int getColumnCount()
StarTable
getColumnCount
in interface StarTable
public abstract long getRowCount()
StarTable
getRowCount
in interface StarTable
public abstract RowSequence getRowSequence() throws IOException
StarTable
getRowSequence
in interface StarTable
IOException
- if there is an error providing accessCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.