org.cytoscape.cyni
Class CyniTable

java.lang.Object
  extended by org.cytoscape.cyni.CyniTable

public class CyniTable
extends Object


Field Summary
protected  boolean anyMissing
           
protected  boolean ignoreMissing
           
protected  boolean selectedOnly
           
protected  boolean transpose
           
 
Constructor Summary
CyniTable(CyniTable duplicate)
          Create a cyni table from an existing one.
CyniTable(org.cytoscape.model.CyTable table, String[] attributes, boolean transpose, boolean ignoreMissing, boolean selectedOnly)
          Create a Cyni table from the current selected table.
CyniTable(int rows, int cols)
          Create an empty Cyni Table with the specified number of columns and rows.
 
Method Summary
 void changeOrderRowsByColumnValuesOrder(List<Object> colValues)
          Changes the order of the rows according to the values of a selected column The method supposes that the first value of the input list corresponds to the first element of the column and so on.
 void changeOrderRowsToRandom()
          Changes the order of the rows in the table randomly
 boolean columnHasMissingValue(int column)
          Tells if the specified column has a missing value.
 double doubleValue(int row, int column)
          Returns the double value for the specified row and column combination
 ArrayList<String> getAttributeStringValues()
          Returns the list of all possible strings values in the table
 Integer getColIndex(Object label)
          Returns the index column for the specified label.
 Object getColLabel(int col)
          Returns the label for the specified column.
 Object[] getColLabels()
          Returns the array with all column labels.
 double getColWeight(int col)
          Returns the weight for the specified column.
 double[] getColWeights()
          Returns the array of weights for the columns.
 int getNumPossibleStrings(int index, boolean inRow)
          Returns the number of possible/different strings stored in the defined column or row
 double[] getRank(int row)
          Returns an array with a number for each position representing the rank of the value in the whole row
 Integer getRowIndex(Object label)
          Returns the index row for the specified label.
 Object getRowLabel(int row)
          Returns the label for the specified row.
 Object[] getRowLabels()
          Returns the array with all row labels.
 double getRowWeight(int row)
          Returns the weight for the specified row.
 double[] getRowWeights()
          Returns the array of weights for the rows.
 Class getType(int row, int column)
          Returns the type of for the specified row and column combination.
 Object getValue(int row, int column)
          Returns the value for the specified row and column
 boolean hasAnyMissingValue()
          Returns if the table has any missing value
 boolean hasValue(int row, int column)
          Returns if the content of the table for the specified row and column combination has a real value.
 int integerValue(int row, int column)
          Returns the integer value for the specified row and column combination.
 boolean isTransposed()
          Returns if the table is transposed
 int nColumns()
          Returns the number of columns in the table.
 int nRows()
          Returns the number of rows in the table.
 void resetOrderRows()
          Changes the order to the initial internal state
 boolean rowHasMissingValue(int row)
          Tells if the specified row has a missing value.
 void setColLabel(int col, Object label)
          Set the label for the specified column.
 void setColWeight(int col, double value)
          Set the weight for the specified column.
 void setRowLabel(int row, Object label)
          Set the label for the specified row.
 void setRowWeight(int row, double value)
          Set the weight for the specified row.
 void setUniformWeights()
          Set the weights to a constant value.
 String stringValue(int row, int column)
          Returns the string value for the specified row and column combination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transpose

protected boolean transpose

anyMissing

protected boolean anyMissing

ignoreMissing

protected boolean ignoreMissing

selectedOnly

protected boolean selectedOnly
Constructor Detail

CyniTable

public CyniTable(org.cytoscape.model.CyTable table,
                 String[] attributes,
                 boolean transpose,
                 boolean ignoreMissing,
                 boolean selectedOnly)
Create a Cyni table from the current selected table. The Cyni Table will contain the columns of the CyTable that are defined in the attributes variable

Parameters:
attribute - name of the columns to store
table - CyTable
transpose - true if we are transposing this table
ignoreMissing - true if the new table will not have any row with missing values
selectedOnly - true if the new table will only contains rows that correspond to selected nodes

CyniTable

public CyniTable(CyniTable duplicate)
Create a cyni table from an existing one.

Parameters:
duplicate - The cyni table to duplicate

CyniTable

public CyniTable(int rows,
                 int cols)
Create an empty Cyni Table with the specified number of columns and rows.

Parameters:
rows - number of rows
cols - number of cols
Method Detail

isTransposed

public boolean isTransposed()
Returns if the table is transposed

Returns:
True if the table is transposed

hasAnyMissingValue

public boolean hasAnyMissingValue()
Returns if the table has any missing value

Returns:
True if the table has any missing value

nRows

public int nRows()
Returns the number of rows in the table.

Returns:
The number of rows in the table.

nColumns

public int nColumns()
Returns the number of columns in the table.

Returns:
The number of columns in the table

getValue

public Object getValue(int row,
                       int column)
Returns the value for the specified row and column

Parameters:
row - The number of the row.
column - The number of the column.
Returns:
The value for the column and row

getAttributeStringValues

public ArrayList<String> getAttributeStringValues()
Returns the list of all possible strings values in the table

Returns:
The list of all possible strings values in the table

doubleValue

public double doubleValue(int row,
                          int column)
Returns the double value for the specified row and column combination

Parameters:
row - The number of the row.
column - The number of the column.
Returns:
The double value, if the content is not a number, it returns a not a number value

integerValue

public int integerValue(int row,
                        int column)
Returns the integer value for the specified row and column combination.

Parameters:
row - The number of the row.
column - The number of the column.
Returns:
The integer value, if the content is not a number, it returns a zero value.

stringValue

public String stringValue(int row,
                          int column)
Returns the string value for the specified row and column combination.

Parameters:
row - The number of the row.
column - The number of the column.
Returns:
The string value, if the content is not a string, it returns an empty string.

hasValue

public boolean hasValue(int row,
                        int column)
Returns if the content of the table for the specified row and column combination has a real value.

Parameters:
row - The number of the row.
column - The number of the column.
Returns:
False if the content of the table for that cell is null or it doesn't exist

rowHasMissingValue

public boolean rowHasMissingValue(int row)
Tells if the specified row has a missing value.

Parameters:
row - The number of the row.
Returns:
False if the content of that row is null for one of its values or the specified row doesn't exist

columnHasMissingValue

public boolean columnHasMissingValue(int column)
Tells if the specified column has a missing value.

Parameters:
column - The number of the column.
Returns:
False if the content of that column is null for one of its values or the specified column doesn't exist

getType

public Class getType(int row,
                     int column)
Returns the type of for the specified row and column combination.

Parameters:
row - The number of the row.
column - The number of the column.
Returns:
The type of that table content

getNumPossibleStrings

public int getNumPossibleStrings(int index,
                                 boolean inRow)
Returns the number of possible/different strings stored in the defined column or row

Parameters:
index - The index of the row or column.
inRow - True if the index corresponds to a row index, false if it is for a column
Returns:
The number of different strings stored in the selected row or column or 0 if the row or column does not contain strings

setUniformWeights

public void setUniformWeights()
Set the weights to a constant value.


getRowWeights

public double[] getRowWeights()
Returns the array of weights for the rows.

Returns:
The array of weights for the rows.

getRowWeight

public double getRowWeight(int row)
Returns the weight for the specified row.

Parameters:
row - The number of the row.
Returns:
The weight for the specified row.

getColWeights

public double[] getColWeights()
Returns the array of weights for the columns.

Returns:
The array of weights for the columns.

getColWeight

public double getColWeight(int col)
Returns the weight for the specified column.

Parameters:
col - The number of the column.
Returns:
The weight for the specified column.

setRowWeight

public void setRowWeight(int row,
                         double value)
Set the weight for the specified row.

Parameters:
row - The number of the row.
value - The weight

setColWeight

public void setColWeight(int col,
                         double value)
Set the weight for the specified column.

Parameters:
col - The number of the column.
value - The weight

getColLabels

public Object[] getColLabels()
Returns the array with all column labels.

Returns:
The array with all column labels.

getColLabel

public Object getColLabel(int col)
Returns the label for the specified column.

Parameters:
col - The number of the column.
Returns:
The label for the specified column.

setColLabel

public void setColLabel(int col,
                        Object label)
Set the label for the specified column.

Parameters:
col - The number of the column.
label - The label.

getColIndex

public Integer getColIndex(Object label)
Returns the index column for the specified label.

Parameters:
label - The label object.
Returns:
The index column for the specified label or 0 if the label does not exist.

getRowLabels

public Object[] getRowLabels()
Returns the array with all row labels.

Returns:
The array with all row labels.

getRowLabel

public Object getRowLabel(int row)
Returns the label for the specified row.

Parameters:
row - The number of the row.
Returns:
The label for the specified row.

getRowIndex

public Integer getRowIndex(Object label)
Returns the index row for the specified label.

Parameters:
label - The label object.
Returns:
The index row for the specified label or 0 if the label does not exist.

setRowLabel

public void setRowLabel(int row,
                        Object label)
Set the label for the specified row.

Parameters:
row - The number of the row.
label - The label.

changeOrderRowsToRandom

public void changeOrderRowsToRandom()
Changes the order of the rows in the table randomly


resetOrderRows

public void resetOrderRows()
Changes the order to the initial internal state


changeOrderRowsByColumnValuesOrder

public void changeOrderRowsByColumnValuesOrder(List<Object> colValues)
Changes the order of the rows according to the values of a selected column The method supposes that the first value of the input list corresponds to the first element of the column and so on. If the list of column values has different size than the number of rows of the table, the change of order will not proceed.

Parameters:
colValues - The list of values for the selected column

getRank

public double[] getRank(int row)
Returns an array with a number for each position representing the rank of the value in the whole row

Parameters:
row - The number of the row.
Returns:
The array with the ranks


Copyright © 2013. All Rights Reserved.