Package org.cytoscape.model
Interface CyRow
-
public interface CyRow
This interface represents one row in a CyTable.Module:
model-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>model-api</artifactId> </dependency>
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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> T
get(String fullyQualifiedName, Class<? extends T> type)
Returns the value found for this row in the specified column with the specified type.<T> T
get(String fullyQualifiedName, Class<? extends T> type, T defaultValue)
Returns the value found for this row in the specified column with the specified type.default <T> T
get(String namespace, String columnName, Class<? extends T> type)
Returns the value found for this row in the specified column with the specified type.default <T> T
get(String namespace, 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 fully-qualified column names to Objects that contain the values contained in this Row.<T> List<T>
getList(String fullyQualifiedName, Class<T> listElementType)
Returns a list which is a view on the underlying column value for this row.<T> List<T>
getList(String fullyQualifiedName, Class<T> listElementType, List<T> defaultValue)
Returns a list which is a view on the underlying column value for this row.default <T> List<T>
getList(String namespace, String columnName, Class<T> listElementType)
Returns a list which is a view on the underlying column value for this row.default <T> List<T>
getList(String namespace, 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 fullyQualifiedName)
Returns the Object that contains the value for the specified column.default Object
getRaw(String namespace, String columnName)
Returns the Object that contains the value for the specified column.CyTable
getTable()
Returns theCyTable
that this row belongs to.boolean
isSet(String fullyQualifiedName)
Indicates whether the column of the specified type contains a non-null value.default boolean
isSet(String namespace, String columnName)
Indicates whether the column of the specified type contains a non-null value.default <T> void
set(String namespace, String columnName, T value)
Sets the specified column for this row to the specified value.<T> void
set(String fullyQualifiedName, T value)
Sets the specified column for this row to the specified value.
-
-
-
Method Detail
-
get
<T> T get(String fullyQualifiedName, Class<? extends T> type)
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:
fullyQualifiedName
- The fully-qualified name identifying the column.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!
- See Also:
get(String, String, Class)
-
get
default <T> T get(String namespace, String columnName, Class<? extends T> type)
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 column.namespace
- The column namespace, or null to indicate no namespace.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 fullyQualifiedName, 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:
fullyQualifiedName
- The fully-qualified 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!
- See Also:
get(String, String, Class, Object)
-
get
default <T> T get(String namespace, 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:
namespace
- The column namespace, or null to indicate no namespace.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 fullyQualifiedName, 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:
fullyQualifiedName
- The fully-qualified 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!
- See Also:
getList(String, String, Class)
-
getList
default <T> List<T> getList(String namespace, 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:
namespace
- The column namespace, or null to indicate no namespace.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 fullyQualifiedName, 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:
fullyQualifiedName
- The fully-qualified 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!
- See Also:
getList(String, String, Class, List)
-
getList
default <T> List<T> getList(String namespace, 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:
namespace
- The column namespace, or null to indicate no namespace.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 fullyQualifiedName, 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 callgetList()
and update the resulting list.- Type Parameters:
T
- The generic type of the value to assign the specified column in this row.- Parameters:
fullyQualifiedName
- The fully-qualified 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 withCyTable.createListColumn(java.lang.String, java.lang.Class<T>, boolean)
!- Throws:
IllegalArgumentException
- If the column does not yet exist or if the the value does not match the column type.- See Also:
set(String, String, Object)
-
set
default <T> void set(String namespace, 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 callgetList()
and update the resulting list.- Type Parameters:
T
- The generic type of the value to assign the specified column in this row.- Parameters:
namespace
- The column namespace, or null to indicate no namespace.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 withCyTable.createListColumn(java.lang.String, java.lang.Class<T>, 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 fullyQualifiedName)
Indicates whether the column of the specified type contains a non-null value.- Parameters:
fullyQualifiedName
- The fully-qualified name identifying the attribute.- Returns:
- true if the value specified in this row at this column of the specified type is not null.
- See Also:
isSet(String, String)
-
isSet
default boolean isSet(String namespace, String columnName)
Indicates whether the column of the specified type contains a non-null value.- Parameters:
namespace
- The column namespace, or null to indicate no namespace.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 fully-qualified column names to Objects that contain the values contained in this Row.
-
getRaw
Object getRaw(String fullyQualifiedName)
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:
fullyQualifiedName
- The fully-qualified name identifying the attribute.- Returns:
- The row Object that represents the value in a column.
- See Also:
getRaw(String, String)
-
getRaw
default Object getRaw(String namespace, 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:
namespace
- The column namespace, or null to indicate no namespace.columnName
- The name identifying the attribute.- Returns:
- The row Object that represents the value in a column.
-
-