Interface CySubNetwork

All Superinterfaces:
CyDisposable, CyIdentifiable, CyNetwork

public interface CySubNetwork extends 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.
  • Method Details

    • getRootNetwork

      CyRootNetwork getRootNetwork()
      Return the CyRootNetwork that contains this CySubNetwork.
      Returns:
      the CyRootNetwork that contains this CySubNetowrk.
    • addNode

      boolean addNode(CyNode node)
      Adds a node to this CySubNetwork. Note that the added node is not a new node and must already exist in the CyRootNetwork.
      Parameters:
      node - CyNode to add to this subnetwork
      Returns:
      true if the node was successfully added to the subnetwork, false otherwise.
    • addEdge

      boolean addEdge(CyEdge edge)
      Adds an edge to this CySubNetwork. Note that the added edge is not a new edge and must already exist in the CyRootNetwork. 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 the CyRootNetwork.
      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 new CyNode in both this subnetwork AND in the CyRootNetwork.
      Specified by:
      addNode in interface CyNetwork
      Returns:
      A new CyNode that exists in both this subnetwork and the associated CyRootNetwork.
    • addEdge

      CyEdge addEdge(CyNode source, CyNode target, boolean directed)
      A shortcut method that Creates a new CyEdge in both this subnetwork AND in the CyRootNetwork.
      Specified by:
      addEdge in interface CyNetwork
      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

      boolean removeNodes(Collection<CyNode> node)
      Removes a node from this CySubNetwork but not from the CyRootNetwork. The node is removed from the CySubNetwork, but not deleted from the CyRootNetwork.
      Specified by:
      removeNodes in interface CyNetwork
      Parameters:
      node - Node to remove from this subnetwork
      Returns:
      true if the node was successfully removed from the specified subnetwork, false otherwise.
    • removeEdges

      boolean removeEdges(Collection<CyEdge> edge)
      Removes a edge from this CySubNetwork but not from the CyRootNetwork. The edge is removed from the CySubNetwork, but not deleted from the CyRootNetwork.
      Specified by:
      removeEdges in interface CyNetwork
      Parameters:
      edge - Edge to remove from this subnetwork
      Returns:
      true if the edge was successfully removed from the specified subnetwork, false otherwise.