|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.table.AbstractStarTable
uk.ac.starlink.table.RandomStarTable
uk.ac.starlink.table.BeanStarTable
public class BeanStarTable
StarTable which displays beans. The table is constructed to display beans of a particular class, and each of its rows displays one instance of this class. It has a column for each readable property. As usual, a bean is anything which has likely-looking getter methods, though since this class uses the java.beans package any cleverer stuff held in BeanInfos will get used as well/instead.
Constructor Summary | |
---|---|
BeanStarTable(Class clazz)
Constructs a new table which will hold beans which are all instances of a given class. |
Method Summary | |
---|---|
Object |
getCell(long irow,
int icol)
The AbstractStarTable implementation of this method throws an UnsupportedOperationException, since unless otherwise provided there is no random access. |
int |
getColumnCount()
Returns the number of columns in this table. |
ColumnInfo |
getColumnInfo(int icol)
Returns the object describing the data in a given column. |
String[] |
getColumnProperties()
Returns an array of the property names which correspond to the columns of this table. |
Object[] |
getData()
Returns the array of objects which this model displays, one per row. |
long |
getRowCount()
The number of rows in this table. |
void |
setColumnInfo(String name,
ValueInfo info)
Resets the metadata for a column representing a property with a given name. |
void |
setColumnProperties(String[] propNames)
Fixes the columns which are to be used for this table. |
void |
setData(Object[] data)
Populates this model with items. |
Methods inherited from class uk.ac.starlink.table.RandomStarTable |
---|
getRowSequence, isRandom |
Methods inherited from class uk.ac.starlink.table.AbstractStarTable |
---|
checkedLongToInt, getColumnAuxDataInfos, getName, getParameterByName, getParameters, getRow, getURL, setName, setParameter, setParameters, setURL |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanStarTable(Class clazz) throws IntrospectionException
clazz
- class of which all beans held by this table are members
IntrospectionException
Method Detail |
---|
public void setData(Object[] data)
data
- array of items, one for each row. This array's
runtime type must match that for which this model was
constructed (on pain of ClassCastException)public Object[] getData()
public long getRowCount()
RandomStarTable
getRowCount
in interface StarTable
getRowCount
in class RandomStarTable
public int getColumnCount()
StarTable
getColumnCount
in interface StarTable
getColumnCount
in class AbstractStarTable
public ColumnInfo getColumnInfo(int icol)
StarTable
getColumnInfo
in interface StarTable
getColumnInfo
in class AbstractStarTable
icol
- the column for which header information is required
public void setColumnInfo(String name, ValueInfo info)
name
- property's programmatic nameinfo
- new column metadatapublic String[] getColumnProperties()
public void setColumnProperties(String[] propNames)
propNames
is an array of the programmatic names of
each of the properties of this bean which is used to get a column
value.
propNames
- array of programmatic names of properties
to be used as columnspublic Object getCell(long irow, int icol) throws IOException
AbstractStarTable
getCell
in interface StarTable
getCell
in class AbstractStarTable
irow
- the index of the cell's rowicol
- the index of the cell's column
IOException
- if there is an error reading the data
|
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 |