|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.table.AbstractStarTable
public abstract class 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. |
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. |
DescribedValue |
getParameterByName(java.lang.String parname)
Returns a parameter (table-wide metadata item) of this table located by its name. |
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) . |
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. |
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 |
setParameter(DescribedValue dval)
Adds the given DescribedValue to the list of parameter metadata objects associated with 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. |
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 java.util.List<ValueInfo> getColumnAuxDataInfos()
getColumnAuxDataInfos
in interface StarTable
ColumnInfo.getAuxData()
public java.util.List<DescribedValue> getParameters()
StarTable
getParameters
in interface StarTable
public void setParameters(java.util.List<DescribedValue> 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 java.lang.String getName()
StarTable
getName
in interface StarTable
public void setName(java.lang.String name)
setName
in interface StarTable
name
- the table name - may be nullpublic java.net.URL getURL()
StarTable
getURL
in interface StarTable
public void setURL(java.net.URL url)
setURL
in interface StarTable
url
- the URL where this table lives - may be nullpublic DescribedValue getParameterByName(java.lang.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 java.lang.Object getCell(long irow, int icol) throws java.io.IOException
getCell
in interface StarTable
irow
- the index of the cell's rowicol
- the index of the cell's column
java.io.IOException
- if there is an error reading the datapublic java.lang.Object[] getRow(long irow) throws java.io.IOException
getCell(long, int)
.
getRow
in interface StarTable
irow
- the index of the row to retrieve
java.io.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 java.io.IOException
StarTable
getRowSequence
in interface StarTable
java.io.IOException
- if there is an error providing access
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |