|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.table.WrapperStarTable
uk.ac.starlink.ttools.filter.ReplaceValueTable
public class ReplaceValueTable
Wrapper table which makes replacements of named values with other named values in some of its columns.
Field Summary |
---|
Fields inherited from class uk.ac.starlink.table.WrapperStarTable |
---|
baseTable |
Constructor Summary | |
---|---|
ReplaceValueTable(StarTable baseTable,
boolean[] colFlags,
String oldStr,
String newStr)
Constructs a new ReplaceValueTable with the same replacement taking place in zero or more of the base table's columns, as described by an array of flags. |
|
ReplaceValueTable(StarTable baseTable,
int[] icols,
String[] oldStrs,
String[] newStrs)
Constructs a new ReplaceValueTable from parallel arrays describing the columns to change and the old and new values. |
Method Summary | |
---|---|
Object |
getCell(long irow,
int icol)
Returns the contents of a given table cell. |
ColumnInfo |
getColumnInfo(int icol)
Returns the object describing the data in a given column. |
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. |
Methods inherited from class uk.ac.starlink.table.WrapperStarTable |
---|
checkedLongToInt, getBaseTable, getColumnAuxDataInfos, getColumnCount, getName, getParameterByName, getParameters, getRowCount, getURL, isRandom, setName, setParameter, setURL, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ReplaceValueTable(StarTable baseTable, boolean[] colFlags, String oldStr, String newStr) throws IOException
baseTable
- base tablecolFlags
- array of flags for each column of the table,
true only for those columns which should be modifiedoldStr
- value to be replacednewStr
- replacement value
IOException
public ReplaceValueTable(StarTable baseTable, int[] icols, String[] oldStrs, String[] newStrs) throws IOException
icols
, oldStrs
and
newStrs
must have the same number of elements.
Indices in icols
ought not to be repeated.
baseTable
- base tableicols
- array of column indices in which replacements
will occuroldStrs
- array of strings to be replaced,
one for each of the columns in icols
newStrs
- array of strings to furnish replacement values,
one for each of the columns in icols
IOException
Method Detail |
---|
public ColumnInfo getColumnInfo(int icol)
StarTable
getColumnInfo
in interface StarTable
getColumnInfo
in class WrapperStarTable
icol
- the column for which header information is required
public 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 datapublic RowSequence getRowSequence() throws IOException
StarTable
getRowSequence
in interface StarTable
getRowSequence
in class WrapperStarTable
IOException
- if there is an error providing access
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |