Package org.cytoscape.model
Interface CyTableManager
public interface CyTableManager
A singleton object for managing registered
CyTable
s.
When a CyTable
is created through a CyTableFactory
,
it exists independently from the rest of Cytoscape.
However, when a CyTable
is registered through the CyTableManager
,
CyTableManager
does the following things for the CyTable
:
-
It fires the
TableAddedEvent
to inform other parts of Cytoscape that theCyTable
was added to theCyTableManager
. -
It also makes the
CyTable
available to other parts of Cytoscape through methods likegetAllTables(boolean)
. -
Because registering the
CyTable
notifies Cytoscape about theCyTable
, Cytoscape will ensure that theCyTable
is saved (seeCyTable.setSavePolicy(org.cytoscape.model.SavePolicy)
). If theCyTable
is not registered with theCyTableManager
, it will not be saved according to itsSavePolicy
.
This interface, unfortunately, uses very confusing method names. Here is an explanation.
-
Associated
CyTable
s are explicitly mapped toCyNetwork
,CyNode
s, orCyEdge
s through theCyNetworkTableManager
. AssociatedCyTable
s are obtained throughgetLocalTables(java.lang.Class<? extends org.cytoscape.model.CyIdentifiable>)
. -
Unassociated
CyTable
s are not explicitly mapped to network objects. Note that columns in an unassociated table can still be "mapped" to network objects when an associated table has a virtual column from an unassociated table. Unassigned tables are obtained fromgetGlobalTables()
.
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 TypeMethodDescriptionvoid
Registers a new table with the manager and fires a TableAddedEvent event.void
deleteTable(long suid)
Deletes a mutable table.getAllTables(boolean includePrivate)
Returns a Set of all tables with the specified visibility.Returns a set of all global tables.getLocalTables(Class<? extends CyIdentifiable> type)
Returns set of all local tables for the given data type.getTable(long suid)
Returns the table with the specified SUID.void
reset()
Releases all currently held references and resources.
-
Method Details
-
getAllTables
Returns a Set of all tables with the specified visibility.- Parameters:
includePrivate
- Whether to include private CyTables in the list (i.e. all possible CyTables) or not.- Returns:
- A Set containing CyTable SUIDs either including private CyTables (i.e. meaning all possible CyTables) or just public CyTables.
-
addTable
Registers a new table with the manager and fires a TableAddedEvent event.- Parameters:
table
- a non-null CyTable that will be added to the manager
-
getTable
Returns the table with the specified SUID.- Parameters:
suid
- The SUID identifying the CyTable.- Returns:
- The CyTable identified by the suid. Will return null if a CyTable doesn't exist for the specified SUID.
-
deleteTable
void deleteTable(long suid)Deletes a mutable table.- Parameters:
suid
- the SUID identifying the CyTable to be deleted- Throws:
IllegalArgumentException
- if the table that we requested to be deleted is immutable or if any of its columns are virtual columns in other tables
-
reset
void reset()Releases all currently held references and resources.
Cytoscape Backwards Compatibility (DO NOT USE): This method may change or be removed in future minor version upgrades of Cytoscape. It is not safe for Apps to call or override this method. -
getGlobalTables
Returns a set of all global tables. "Global tables" are tables that are not explicitly mapped toCyNetwork
s,CyNode
s, andCyEdge
s. throughCyNetworkTableManager
.- Returns:
- All registered global tables
-
getLocalTables
Returns set of all local tables for the given data type. "Local tables" are tables that are explicitly mapped toCyNetwork
s,CyNode
s, andCyEdge
s. This method has nothing to do withCyNetwork.LOCAL_ATTRS
.- Parameters:
type
- Type of the network object, i.e.,CyNetwork.class
,CyNode.class
, orCyEdge.class
.- Returns:
- Set of all registered tables associated with the given data type.
-