|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.starlink.table.WrapperStarTable | +--uk.ac.starlink.table.ColumnPermutedStarTable
Wrapper table which provides a view of a base table in which the columns are permuted. Each column in the wrapper table is a view of one in the base table. It is permitted for the wrapper to contain multiple views of the same column in the base, but note that modifying a cell in one of these will modify it in the other.
An int[] array, columnMap, is used to keep track of which columns in this table correspond to which columns in the base table; the n'th column in this table corresponds to the columnMap[n]'th column in the base table. The columnMap array may contain duplicate entries, but all its entries must be in the range 0..baseTable.getColumnCount()-1. This table will have columnMap.length entries.
Field Summary |
Fields inherited from class uk.ac.starlink.table.WrapperStarTable |
baseTable |
Constructor Summary | |
ColumnPermutedStarTable(StarTable baseTable,
int[] columnMap)
Constructs a new ColumnPermutedStarTable from a base StarTable and a columnMap array. |
Method Summary | |
Object |
getCell(long irow,
int icol)
Returns the contents of a given table cell. |
int |
getColumnCount()
Returns the number of columns in this table. |
ColumnInfo |
getColumnInfo(int icol)
Returns the object describing the data in a given column. |
int[] |
getColumnMap()
Returns the mapping used to define the permutation of the columns of this table with respect to the base table. |
Object[] |
getRow(long irow)
Returns the contents of a given table row. |
RowSequence |
getRowSequence()
Returns an object which can iterate over all the rows in the table sequentially. |
void |
setColumnMap(int[] columnMap)
Sets the mapping used to define the permutation of the columns of this table with respect to the base table. |
Methods inherited from class uk.ac.starlink.table.WrapperStarTable |
checkedLongToInt, getBaseTable, getColumnAuxDataInfos, getName, getParameterByName, getParameters, getRowCount, getURL, isRandom, setName, setURL |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ColumnPermutedStarTable(StarTable baseTable, int[] columnMap)
baseTable
- the table on which this one is basedcolumnMap
- array describing where each column of this table
comes from in baseTableMethod Detail |
public int[] getColumnMap()
public void setColumnMap(int[] columnMap)
columnMap
- column permutation mappublic int getColumnCount()
StarTable
getColumnCount
in interface StarTable
getColumnCount
in class WrapperStarTable
public ColumnInfo getColumnInfo(int icol)
StarTable
getColumnInfo
in interface StarTable
getColumnInfo
in class WrapperStarTable
icol
- the column for which header information is required
public RowSequence getRowSequence() throws IOException
StarTable
getRowSequence
in interface StarTable
getRowSequence
in class WrapperStarTable
IOException
- if there is an error providing accesspublic Object getCell(long irow, int icol) throws IOException
StarTable
getCell
in interface StarTable
getCell
in class WrapperStarTable
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
StarTable
getRow
in interface StarTable
getRow
in class WrapperStarTable
irow
- the index of the row to retrieve
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 |