org.broadinstitute.genee.matrix
Interface MetadataModel


public interface MetadataModel

Stores annotations for the rows or columns of a dataset.


Method Summary
 Vector add(String columnName, Class<?> columnClass)
          Appends the specified column name to the end of this meta data (optional operation).
 Vector get(int metadataIndex)
          Returns the vector at the specified metadata index.
 Vector get(String name)
          Returns the vector witht the specified name.
 int getColumnIndex(String columnName)
          Returns the column index for the given column name or -1 if the name is not found.
 String getColumnName(int metadataIndex)
          Returns the name of the column at metadataIndex.
 int getItemCount()
          Returns the number of items that a vector in this instance contains.
 int getMetadataCount()
          Returns the number of columns in this meta data instance.
 Object getValue(int itemIndex, int metadataIndex)
          Returns the value for the element at itemIndex and metadataIndex.
 Object getValue(int itemIndex, String columnName)
          Returns the value for the element at metadataIndex and columnName.
 void remove(int metadataIndex)
          Removes the column at the specified position in this meta data instance (optional operation).
 void setValue(int itemIndex, int metadataIndex, Object aValue)
          Sets the value in the cell at columnName and itemIndex to aValue.
 void setValue(int itemIndex, String columnName, Object aValue)
          Sets the value in the cell at columnName and itemIndex to aValue.
 

Method Detail

add

Vector add(String columnName,
           Class<?> columnClass)
Appends the specified column name to the end of this meta data (optional operation).

Parameters:
columnName - The column name to be inserted into this meta data instance.
columnClass - The class of the column to be inserted.
Returns:
the added vector.
Throws:
UnsupportedOperationException - if the addColumn method is not supported by this meta data instance.

get

Vector get(int metadataIndex)
Returns the vector at the specified metadata index.

Parameters:
metadataIndex - the metadata index
Returns:
the vector

get

Vector get(String name)
Returns the vector witht the specified name.

Parameters:
name - the vector name
Returns:
the vector

getColumnName

String getColumnName(int metadataIndex)
Returns the name of the column at metadataIndex. Note: this name needs to be unique; two columns in a meta data instance can not have the same name.

Parameters:
metadataIndex - the index of the column
Returns:
the name of the column

getItemCount

int getItemCount()
Returns the number of items that a vector in this instance contains.

Returns:
the item count

getMetadataCount

int getMetadataCount()
Returns the number of columns in this meta data instance.

Returns:
the number of columns.

getColumnIndex

int getColumnIndex(String columnName)
Returns the column index for the given column name or -1 if the name is not found.

Parameters:
columnName - the column name
Returns:
the column index

getValue

Object getValue(int itemIndex,
                int metadataIndex)
Returns the value for the element at itemIndex and metadataIndex.

Parameters:
itemIndex - the item whose value is to be queried
metadataIndex - the column name whose value is to be queried
Returns:
the value Object at the specified element.

getValue

Object getValue(int itemIndex,
                String columnName)
Returns the value for the element at metadataIndex and columnName.

Parameters:
itemIndex - the item whose value is to be queried
columnName - the column name whose value is to be queried
Returns:
the value Object at the specified element.

remove

void remove(int metadataIndex)
Removes the column at the specified position in this meta data instance (optional operation). Shifts any subsequent columns to the left (subtracts one from their indices).

Parameters:
metadataIndex - the column index to remove.
Throws:
UnsupportedOperationException - if the remove method is not supported by this list.
IndexOutOfBoundsException - if the index is out of range (metadataIndex < 0 || index >= getColumnCount()).

setValue

void setValue(int itemIndex,
              int metadataIndex,
              Object aValue)
Sets the value in the cell at columnName and itemIndex to aValue.

Parameters:
aValue - the new value
itemIndex - the item whose value is to be changed
metadataIndex - the metadata index whose value is to be changed
See Also:
getValue(int, int)

setValue

void setValue(int itemIndex,
              String columnName,
              Object aValue)
Sets the value in the cell at columnName and itemIndex to aValue.

Parameters:
aValue - the new value
itemIndex - the item whose value is to be changed
columnName - the column name whose value is to be changed
See Also:
getValue(int, int)