Cytoscape 3.0.1 API

org.cytoscape.model
Interface CyRow


public interface CyRow

This interface represents one row in a CyTable.


Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.

Method Summary
<T> T
get(String columnName, Class<? extends T> type)
          Returns the value found for this row in the specified column with the specified type.
<T> T
get(String columnName, Class<? extends T> type, T defaultValue)
          Returns the value found for this row in the specified column with the specified type.
 Map<String,Object> getAllValues()
          Returns a map of column names to Objects that contain the values contained in this Row.
<T> List<T>
getList(String columnName, Class<T> listElementType)
          Returns a list which is a view on the underlying column value for this row.
<T> List<T>
getList(String columnName, Class<T> listElementType, List<T> defaultValue)
          Returns a list which is a view on the underlying column value for this row.
 Object getRaw(String columnName)
          Returns the Object that contains the value for the specified column.
 CyTable getTable()
          Returns the CyTable that this row belongs to.
 boolean isSet(String columnName)
          Indicates whether the column of the specified type contains a non-null value.
<T> void
set(String columnName, T value)
          Sets the specified column for this row to the specified value.
 

Method Detail

get

<T> T get(String columnName,
          Class<? extends T> type)
Returns the value found for this row in the specified column with the specified type. If the column name doesn't exist

Type Parameters:
T - The generic type of the specified column.
Parameters:
columnName - The name identifying the attribute.
type - The type of the column.
Returns:
The value found for this row in the specified column and null if the column does not exist. Please note that this method should not be used to retrieve values that are Lists!

get

<T> T get(String columnName,
          Class<? extends T> type,
          T defaultValue)
Returns the value found for this row in the specified column with the specified type.

Type Parameters:
T - The generic type of the specified column.
Parameters:
columnName - The name identifying the attribute.
type - The type of the column.
defaultValue - The value to return if the column has not previously been set.
Returns:
The value found for this row in the specified column, the default value if the row has not yet been set, and null if the column does not exist. Please note that this method should not be used to retrieve values that are Lists!

getList

<T> List<T> getList(String columnName,
                    Class<T> listElementType)
Returns a list which is a view on the underlying column value for this row. This means updates made to the list are reflected in the column, and vice-versa.

Type Parameters:
T - the generic type of the elements of the list we wish to retrieve.
Parameters:
columnName - The name identifying the attribute.
listElementType - The type of the elements of the list that we wish to retrieve.
Returns:
Returns a list which is a view on the underlying column value for this row, or null if the column does not exist. Please note that this method can only be used to retrieve values that are Lists!

getList

<T> List<T> getList(String columnName,
                    Class<T> listElementType,
                    List<T> defaultValue)
Returns a list which is a view on the underlying column value for this row. This means updates made to the list are reflected in the column, and vice-versa.

Type Parameters:
T - the generic type of the elements of the list we wish to retrieve.
Parameters:
columnName - The name identifying the attribute.
listElementType - The type of the elements of the list that we wish to retrieve.
defaultValue - The List to return if the column has not previously been set.
Returns:
Returns a list which is a view on the underlying column value for this row, the default value if the row has not yet been set, and null if the column does not exist. Please note that this method can only be used to retrieve values that are Lists!

set

<T> void set(String columnName,
             T value)
Sets the specified column for this row to the specified value. To unset a column entry use null for value. When setting a list value to this row, the list is copied. Any further updates to the original list are not reflected in the row. To update the row call getList() and update the resulting list.

Type Parameters:
T - The generic type of the value to assign the specified column in this row.
Parameters:
columnName - The name identifying the attribute.
value - The value to assign the specified column in this row Please note that if "value" is a List it is your responsibility that all the elements are of the type specified when the column was created with CyTable.createListColumn(java.lang.String, java.lang.Class, boolean)!
Throws:
IllegalArgumentException - If the column does not yet exist or if the the value does not match the column type.

isSet

boolean isSet(String columnName)
Indicates whether the column of the specified type contains a non-null value.

Parameters:
columnName - The name identifying the attribute.
Returns:
true if the value specified in this row at this column of the specified type is not null.

getAllValues

Map<String,Object> getAllValues()
Returns a map of column names to Objects that contain the values contained in this Row.

Returns:
A map of column names to Objects that contain the values contained in this Row.

getRaw

Object getRaw(String columnName)
Returns the Object that contains the value for the specified column. The returned object may or may not be of the type that get() for this column will return, for example it may return an equation object that has not yet been evaluated!

Parameters:
columnName - The name identifying the attribute.
Returns:
The row Object that represents the value in a column.

getTable

CyTable getTable()
Returns the CyTable that this row belongs to.

Returns:
the CyTable that this row belongs to.

Cytoscape 3.0.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.