|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.starlink.table.AbstractStarTable
Abstract base class providing an implementation of the generic and straightforward parts of the 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 Summary | |
AbstractStarTable()
|
Method Summary | |
static int |
checkedLongToInt(long lval)
Convenience method to get an int value from a long. |
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 |
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. |
DescribedValue |
getParameterByName(String parname)
Returns a parameter (table-wide metadata item) of this table located by its name. |
List |
getParameters()
Returns a list of table parameters, that is 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) . |
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. |
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 |
setParameter(DescribedValue dval)
Adds the given DescribedValue to the list of parameter metadata objects associated with this table. |
void |
setParameters(List 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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractStarTable()
Method Detail |
public List getColumnAuxDataInfos()
getColumnAuxDataInfos
in interface StarTable
ColumnInfo.getAuxData()
public List getParameters()
StarTable
DescribedValue
object.
getParameters
in interface StarTable
public void setParameters(List parameters)
DescribedValue
object.
parameters
- a List of DescribedValues pertaining
to this tablepublic void setParameter(DescribedValue dval)
StarTable
setParameter
in interface StarTable
dval
- the new parameter datum to addpublic String getName()
StarTable
getName
in interface StarTable
public void setName(String name)
setName
in interface StarTable
name
- the table name - may be nullpublic URL getURL()
StarTable
getURL
in interface StarTable
public void setURL(URL url)
setURL
in interface StarTable
url
- the URL where this table lives - may be nullpublic DescribedValue getParameterByName(String parname)
StarTable
getParameterByName
in interface StarTable
parname
- the name of the table parameter requiredpublic static int checkedLongToInt(long lval)
Tables.checkedLongToInt(long)
.
public boolean isRandom()
isRandom
in interface StarTable
public Object getCell(long irow, int icol) throws IOException
getCell
in interface StarTable
irow
- the index of the cell's rowicol
- the index of the cell's column
IOException
- if there is an error reading the datapublic Object[] getRow(long irow) throws IOException
getCell(long, int)
.
getRow
in interface StarTable
irow
- the index of the row to retrieve
IOException
- if there is an error reading the datapublic abstract ColumnInfo getColumnInfo(int icol)
StarTable
getColumnInfo
in interface StarTable
icol
- the column for which header information is required
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 access
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |