|
TissueInfo API 20091124110011 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Table
Table data storage representation. This interface is designed to provide a fast access to the element of the table while allowing to deal with tables of flexible schemas. This seems a bit antithetic at first, and is translated in a number of function getXValue that return the element of a given type. This design allow to store the instances of the table as elementary types, which saves memory, and enable to pass each element directly to the client without wrapping each value in an object.
The Schema/Data dissociation is mirroring the classical relational database data model. Implementations of this interface are free to store the data the way they prefer. We provide a memory resident array based implementation calledArrayTable for casual task
(small table dimensions). Implementations for relational DBMS could be
developed.
The purpose of this interface was primarily to propose a way to hold a Mineset
(SGI data mining tool) table in memory for post-processing.
| Nested Class Summary | |
|---|---|
static interface |
Table.RowIterator
|
| Method Summary | |
|---|---|
int |
addColumn(String identifier,
Class type)
Adds a new column to this table. |
void |
appendBooleanValue(int column,
boolean value)
Appends a char value to the specified column. |
void |
appendCharValue(int column,
char value)
Appends a char value to the specified column. |
void |
appendDoubleValue(int column,
double value)
Appends a double value to the specified column. |
void |
appendFloatValue(int column,
float value)
Appends a float value to the specified column. |
void |
appendIntValue(int column,
int value)
Table are write once data storage. |
void |
appendObject(int column,
Object value)
Appends a value of type Object to this column. |
Table |
copy()
|
void |
copy(int source_column,
Table.RowIterator source,
int dest_column,
Table.RowIterator dest)
Copy the value at position (column, source) to the position (column, dest). |
Table |
copy(RowFilter filter)
|
Table |
copy(RowFilter rowFilter,
ColumnFilter columnFilter)
|
void |
copy(Table sourceTable,
int source_column,
Table.RowIterator source,
Table destTable,
int dest_column,
Table.RowIterator dest)
Copy the value at position sourceTable(column, source) to the position destTable(column, dest). |
void |
defineColumnsFrom(Table t)
Defines the columns of this table from the columns in source. |
String |
elementToString(int column,
Table.RowIterator row)
|
Table.RowIterator |
firstRow()
Returns an iterator that reference the first instance of this table. |
boolean |
getBooleanValue(int column,
Table.RowIterator row)
Returns the value stored in this position as an boolean, when appropriate. |
char |
getCharValue(int column,
Table.RowIterator row)
Returns the value stored in this position as a char, when appropriate. |
int |
getColumnIndex(String identifier)
Returns the column index associated with this identifier. |
int |
getColumnNumber()
Returns the number of columns of this table. |
ArrayTable.ColumnDescription |
getColumnValues(int i)
|
double[] |
getDoubles(String columnId)
Get the doubles for a particular column id. |
double |
getDoubleValue(int column,
Table.RowIterator row)
Returns the value stored in this position as an double, when appropriate. |
float |
getFloatValue(int column,
Table.RowIterator row)
Returns the value stored in this position as a float, when appropriate. |
String |
getIdentifier(int column)
Returns the identifier associated with this column index. |
int |
getIntValue(int column,
Table.RowIterator row)
Returns the value stored in this position as an int, when appropriate. |
int |
getRowNumber()
Returns the number of row of this table. |
String[] |
getStrings(String columnId)
Get the strings for a particular column id. |
Class<?> |
getType(int column)
Returns the type of the column which index is passed as argument. |
Object |
getValue(int column,
Table.RowIterator row)
Returns the value stored in this position as an Object, when appropriate. |
void |
incrementRowNumber()
|
boolean |
isColumn(String identifier)
Returns true when the identifier designate a column of this column. |
Table.RowIterator |
lastRow()
Returns an iterator that reference the last instance of this table. |
void |
parseAppend(int column,
String value)
Append a value passed as a String. |
boolean |
permutateColumns(String columnName,
int newColumnPosition)
Permutate the position of columns. |
void |
processRows(RowProcessor myRowProcessor)
|
void |
removeColumn(int columnIndex)
Removes a column from this table. |
void |
removeColumn(String identifier)
Removes a column from this table. |
void |
removeLastRow()
Removes the last appended row from each column of this table. |
void |
reserve(int column,
int numElements)
Reserve the space for numElements in the given column. |
void |
setValue(int columnIndex,
Table.RowIterator ri,
boolean value)
|
void |
setValue(int columnIndex,
Table.RowIterator ri,
char value)
|
void |
setValue(int columnIndex,
Table.RowIterator ri,
double value)
|
void |
setValue(int columnIndex,
Table.RowIterator ri,
float value)
|
void |
setValue(int columnIndex,
Table.RowIterator ri,
int value)
|
void |
setValue(int columnIndex,
Table.RowIterator ri,
long value)
|
String |
toString(Table source)
|
String |
toString(Table source,
boolean printData)
Returns a text representation of the table source. |
Table |
transpose(DefineColumnFromRow columnHelper)
|
| Method Detail |
|---|
void incrementRowNumber()
Table copy()
throws TypeMismatchException,
InvalidColumnException
TypeMismatchException
InvalidColumnException
Table copy(RowFilter filter)
throws TypeMismatchException,
InvalidColumnException
TypeMismatchException
InvalidColumnException
Table copy(RowFilter rowFilter,
ColumnFilter columnFilter)
throws TypeMismatchException,
InvalidColumnException
TypeMismatchException
InvalidColumnExceptionArrayTable.ColumnDescription getColumnValues(int i)
void setValue(int columnIndex,
Table.RowIterator ri,
int value)
void setValue(int columnIndex,
Table.RowIterator ri,
long value)
void setValue(int columnIndex,
Table.RowIterator ri,
boolean value)
void setValue(int columnIndex,
Table.RowIterator ri,
float value)
void setValue(int columnIndex,
Table.RowIterator ri,
double value)
void setValue(int columnIndex,
Table.RowIterator ri,
char value)
void processRows(RowProcessor myRowProcessor)
throws TypeMismatchException,
InvalidColumnException
TypeMismatchException
InvalidColumnException
Table transpose(DefineColumnFromRow columnHelper)
throws InvalidColumnException,
TypeMismatchException,
ColumnTypeException
InvalidColumnException
TypeMismatchException
ColumnTypeException
boolean permutateColumns(String columnName,
int newColumnPosition)
throws InvalidColumnException
columnName - The name of the column to movenewColumnPosition - the position to place the column
InvalidColumnException - if the column name or position is not valid
String[] getStrings(String columnId)
throws InvalidColumnException
columnId - The column id to get the strings for
InvalidColumnException - Thrown when the specified index does not identify a column
of this table (negative indices and indices greater than getColumnNumber()
throw this exception).
double[] getDoubles(String columnId)
throws InvalidColumnException
columnId - The column id to get the values for
InvalidColumnException - Thrown when the specified index does not identify a column
of this table (negative indices and indices greater than getColumnNumber()
throw this exception).int getColumnNumber()
int getRowNumber()
String getIdentifier(int column)
int getColumnIndex(String identifier)
throws InvalidColumnException
InvalidColumnExceptionClass<?> getType(int column)
Table.RowIterator firstRow()
Table.RowIterator lastRow()
char getCharValue(int column,
Table.RowIterator row)
throws TypeMismatchException,
InvalidColumnException
TypeMismatchException - Thrown when the element is not a char
InvalidColumnException - Thrown when the specified index does not
identify a column of this table (negative indices and indices greater
than getColumnNumber() throw this exception).
int getIntValue(int column,
Table.RowIterator row)
throws TypeMismatchException,
InvalidColumnException
TypeMismatchException - Thrown when the element is not an integer.
InvalidColumnException - Thrown when the specified index does not
identify a column of this table (negative indices and indices greater
than getColumnNumber() throw this exception).
Object getValue(int column,
Table.RowIterator row)
throws TypeMismatchException,
InvalidColumnException
TypeMismatchException - Thrown when the element is not a subclass
of Object
InvalidColumnException - Thrown when the specified index does not
identify a column of this table (negative indices and indices greater
than getColumnNumber() throw this exception).
float getFloatValue(int column,
Table.RowIterator row)
throws TypeMismatchException,
InvalidColumnException
TypeMismatchException - Thrown when the element is not a float.
InvalidColumnException - Thrown when the specified index does not
identify a column of this table (negative indices and indices greater
than getColumnNumber() throw this exception).
void appendIntValue(int column,
int value)
throws TypeMismatchException
TypeMismatchException - Thrown when the column exists but its type
is incompatible with an int.
void appendCharValue(int column,
char value)
throws TypeMismatchException
TypeMismatchException
void appendBooleanValue(int column,
boolean value)
throws TypeMismatchException
TypeMismatchException
void appendObject(int column,
Object value)
throws TypeMismatchException
TypeMismatchException - Thrown when the column exist s but its type
is incompatible with an Object.
void appendFloatValue(int column,
float value)
throws TypeMismatchException
TypeMismatchException
String elementToString(int column,
Table.RowIterator row)
void parseAppend(int column,
String value)
throws ColumnTypeException
ColumnTypeExceptionStringAppender
int addColumn(String identifier,
Class type)
identifier - The name of the new columntype - The type of the new column
boolean isColumn(String identifier)
void copy(Table sourceTable,
int source_column,
Table.RowIterator source,
Table destTable,
int dest_column,
Table.RowIterator dest)
void copy(int source_column,
Table.RowIterator source,
int dest_column,
Table.RowIterator dest)
void reserve(int column,
int numElements)
void removeColumn(String identifier)
throws InvalidColumnException
identifier - The identifer for the column to remove
InvalidColumnException - Thrown when the specified index does not identify a column
of this table (negative indices and indices greater than getColumnNumber()
throw this exception).void removeColumn(int columnIndex)
columnIndex - Index of the column to remove.
double getDoubleValue(int column,
Table.RowIterator row)
throws TypeMismatchException
TypeMismatchException - Thrown when the element is not a double.
boolean getBooleanValue(int column,
Table.RowIterator row)
throws TypeMismatchException
TypeMismatchException - Thrown when the element is not a boolean.
void appendDoubleValue(int column,
double value)
throws TypeMismatchException
TypeMismatchExceptionString toString(Table source)
String toString(Table source,
boolean printData)
void defineColumnsFrom(Table t)
t - Source for the column definition.void removeLastRow()
|
TissueInfo API 20091124110011 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||