Interface CyNetworkTableManager
Provides access to all network-table relationships. CyTables
can be associated with a CyNetwork by being assigned a
type and namespace within that
CyNetwork. For example, a CyTable that stores
CyNode attributes would be of type CyNode.class.
You can associate multiple CyTables of a particular type
to a CyNetwork as long as each of those CyTables
has a different namespace. For instance, to add multiple node tables to a
CyNetwork, you would call:
setTable(network, CyNode.class, "my namespace", nodeTable1); setTable(network, CyNode.class, "my other namespace", nodeTable2);
So the triple (CyNetwork, type, namespace) refers to exactly
one table at any given time. It's also possible to associate the same
CyTable with multiple (CyNetwork, type, namespace)
combinations.
By default, CyNetworks are associated with network, node, and edge tables
for each of the following namespaces:
- CyNetwork.DEFAULT_ATTRS
- CyNetwork.LOCAL_ATTRS
- CyNetwork.HIDDEN_ATTRS
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
Modifier and TypeMethodDescriptiongetNetworkForTable(CyTable table) Returns the network this table is registered with.Returns a read-only set of all networks managed by this instance.getTable(CyNetwork network, Class<? extends CyIdentifiable> type, String namespace) Returns the table with the specified namespace and type from the network.getTableNamespace(CyTable table) Returns the namespace of this table.getTables(CyNetwork network, Class<? extends CyIdentifiable> type) Returns a read-only map of all of the tables for the specified type from the network.Class<? extends CyIdentifiable>getTableType(CyTable table) voidremoveAllTables(CyNetwork network) Removes all tables associated with the given network.voidremoveTable(CyNetwork network, Class<? extends CyIdentifiable> type, String namespace) Removes the table with the specified namespace and type from the network.voidreset()Clears all the network-table relationships.voidAssociates the given table to the network using the specified namespace and type.
-
Method Details
-
setTable
void setTable(CyNetwork network, Class<? extends CyIdentifiable> type, String namespace, CyTable table) Associates the given table to the network using the specified namespace and type.- Parameters:
network- theCyNetworkto associate the given table to.type- Type ofCyIdentifiableassociated with the table.namespace- thenamespacethe table should belong to.table- the table to associate to the network with the specified namespace and type.
-
getTable
Returns the table with the specified namespace and type from the network.- Parameters:
network- the network to check for the table.type- Type ofCyIdentifiableassociated with the table.namespace- thenamespacethe table should belong to.- Returns:
- the table with the specified namespace and type from the network.
-
getTableType
Returns the type of this table (eitherCyNetwork.class,CyNode.class, orCyEdge.class. If this table is not registered with the CyNetworkTableManager, returns null;- Parameters:
table- the table we're inquiring about- Returns:
- the type of the table or null if the table is not registered
-
getTableNamespace
Returns the namespace of this table. If this table is not registered with the CyNetworkTableManager, returns null;- Parameters:
table- the table we're inquiring about- Returns:
- the namespace of the table or null if the table is not registered
-
getNetworkForTable
Returns the network this table is registered with. If this table is not registered with the CyNetworkTableManager, returns null. In the current implementation this method is iterative and not terribly efficient.- Parameters:
table- the table we're inquiring about- Returns:
- the network this table is associated with, or null
-
removeTable
Removes the table with the specified namespace and type from the network.- Parameters:
network- the network to remove the table from.type- Type ofCyIdentifiableassociated with the table.namespace- thenamespacethe table should belong to.
-
getTables
Returns a read-only map of all of the tables for the specified type from the network. Each table is keyed by its namespace.- Parameters:
network- The network to return the tables of.type- The type of the tables to return.- Returns:
- a read-only map of all the tables for the specified type from the network.
-
reset
void reset()Clears all the network-table relationships. -
getNetworkSet
Returns a read-only set of all networks managed by this instance.- Returns:
- a read-only set of all networks managed by this instance.
-
removeAllTables
Removes all tables associated with the given network.- Parameters:
network- the network whose tables should be removed.
-