Package org.cytoscape.model.subnetwork
Interface CySubNetwork
- All Superinterfaces:
CyDisposable
,CyIdentifiable
,CyNetwork
A CySubNetwork is a
CyNetwork
that is contained within a parent
CyNetwork
. See the description in CyRootNetwork
for
a more complete description of Cytoscape's meta-network model.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.
-
Field Summary
Fields inherited from interface org.cytoscape.model.CyIdentifiable
SUID
Fields inherited from interface org.cytoscape.model.CyNetwork
DEFAULT_ATTRS, HIDDEN_ATTRS, LOCAL_ATTRS, NAME, SELECTED
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds an edge to thisCySubNetwork
.A shortcut method that Creates a newCyEdge
in both this subnetwork AND in theCyRootNetwork
.addNode()
A shortcut method that Creates a newCyNode
in both this subnetwork AND in theCyRootNetwork
.boolean
Adds a node to thisCySubNetwork
.Return theCyRootNetwork
that contains this CySubNetwork.boolean
removeEdges
(Collection<CyEdge> edge) Removes a edge from thisCySubNetwork
but not from theCyRootNetwork
.boolean
removeNodes
(Collection<CyNode> node) Removes a node from thisCySubNetwork
but not from theCyRootNetwork
.Methods inherited from interface org.cytoscape.model.CyDisposable
dispose
Methods inherited from interface org.cytoscape.model.CyIdentifiable
getSUID
Methods inherited from interface org.cytoscape.model.CyNetwork
containsEdge, containsEdge, containsNode, getAdjacentEdgeIterable, getAdjacentEdgeList, getConnectingEdgeList, getDefaultEdgeTable, getDefaultNetworkTable, getDefaultNodeTable, getEdge, getEdgeCount, getEdgeList, getNeighborList, getNode, getNodeCount, getNodeList, getRow, getRow, getSavePolicy, getTable
-
Method Details
-
getRootNetwork
CyRootNetwork getRootNetwork()Return theCyRootNetwork
that contains this CySubNetwork.- Returns:
- the
CyRootNetwork
that contains this CySubNetowrk.
-
addNode
Adds a node to thisCySubNetwork
. Note that the added node is not a new node and must already exist in theCyRootNetwork
.- Parameters:
node
- CyNode to add to this subnetwork- Returns:
- true if the node was successfully added to the subnetwork, false otherwise.
-
addEdge
Adds an edge to thisCySubNetwork
. Note that the added edge is not a new edge and must already exist in theCyRootNetwork
. If the nodes that define the source and target of the edge are not yet contained in the subnetwork, they will be added. The nodes must also already exist in theCyRootNetwork
.- Parameters:
edge
- CyEdge to add to this subnetwork- Returns:
- true if the edge was successfully added to the subnetwork, false otherwise.
-
addNode
CyNode addNode()A shortcut method that Creates a newCyNode
in both this subnetwork AND in theCyRootNetwork
.- Specified by:
addNode
in interfaceCyNetwork
- Returns:
- A new CyNode that exists in both this subnetwork and the associated
CyRootNetwork
.
-
addEdge
A shortcut method that Creates a newCyEdge
in both this subnetwork AND in theCyRootNetwork
.- Specified by:
addEdge
in interfaceCyNetwork
- Parameters:
source
- The source node of the edge. The source node must exist in the root network.target
- The target node of the edge. The target node must exist in the root network.directed
- Whether the edge should be considered directed or not.- Returns:
- A new CyEdge that exists in both this subnetwork and the associated
CyRootNetwork
.
-
removeNodes
Removes a node from thisCySubNetwork
but not from theCyRootNetwork
. The node is removed from the CySubNetwork, but not deleted from theCyRootNetwork
.- Specified by:
removeNodes
in interfaceCyNetwork
- Parameters:
node
- Node to remove from this subnetwork- Returns:
- true if the node was successfully removed from the specified subnetwork, false otherwise.
-
removeEdges
Removes a edge from thisCySubNetwork
but not from theCyRootNetwork
. The edge is removed from the CySubNetwork, but not deleted from theCyRootNetwork
.- Specified by:
removeEdges
in interfaceCyNetwork
- Parameters:
edge
- Edge to remove from this subnetwork- Returns:
- true if the edge was successfully removed from the specified subnetwork, false otherwise.
-