public interface CyNetwork extends CyIdentifiable, CyDisposable
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>
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ATTRS
The name of the default public
CyTable that is created by default for CyNetworks,
CyNodes, and CyEdges.
|
static String |
HIDDEN_ATTRS
The name of the default hidden CyTable that is created
by default for CyNetworks, CyNodes, and
CyEdges.
|
static String |
LOCAL_ATTRS
The name of the local public
CyTable that is created by default for CyNetworks,
CyNodes, and CyEdges.
|
static String |
NAME
A String column created by default for every CyNetwork that
holds the name of the entry.
|
static String |
SELECTED
A boolean column created by default for every CyNode or CyEdge that
holds the selection state of the entry.
|
SUID
Modifier and Type | Method and Description |
---|---|
CyEdge |
addEdge(CyNode source,
CyNode target,
boolean isDirected)
This method is used to create and add an edge to this network.
|
CyNode |
addNode()
This method is used to create and add a node to this network.
|
boolean |
containsEdge(CyEdge edge)
Determine if this CyNetwork contains a particular edge.
|
boolean |
containsEdge(CyNode from,
CyNode to)
Determine if this CyNetwork contains an edge between
two nodes.
|
boolean |
containsNode(CyNode node)
Determine if this CyNetwork contains a particular node.
|
Iterable<CyEdge> |
getAdjacentEdgeIterable(CyNode node,
CyEdge.Type edgeType)
Gets an Iteable of edges that connect to this node.
|
List<CyEdge> |
getAdjacentEdgeList(CyNode node,
CyEdge.Type edgeType)
Get the list of edges that connect to this node.
|
List<CyEdge> |
getConnectingEdgeList(CyNode source,
CyNode target,
CyEdge.Type edgeType)
Get the list of edges that connect two nodes.
|
CyTable |
getDefaultEdgeTable()
A convenience method returns the default attribute table for the edges of this network.
|
CyTable |
getDefaultNetworkTable()
A convenience method returns the default attribute table for this network.
|
CyTable |
getDefaultNodeTable()
A convenience method returns the default attribute table for the nodes of this network.
|
CyEdge |
getEdge(long suid)
Return the CyEdge that has the SUID.
|
int |
getEdgeCount()
Return the number of edges in this network.
|
List<CyEdge> |
getEdgeList()
Return a list of the edges in this network.
|
List<CyNode> |
getNeighborList(CyNode node,
CyEdge.Type edgeType)
Get the list of nodes that neighbor this node where the
definition of "neighbor" is a node that is connected to this
node by the passed edgeType.
|
CyNode |
getNode(long suid)
Return the CyNode that has the SUID.
|
int |
getNodeCount()
Return the number of nodes in this network.
|
List<CyNode> |
getNodeList()
Return a list of the nodes in this network.
|
CyRow |
getRow(CyIdentifiable entry)
A convenience method that returns the row in the default table
for this object.
|
CyRow |
getRow(CyIdentifiable entry,
String namespace)
Returns the row for the specified table name for this object.
|
SavePolicy |
getSavePolicy()
Returns how (or if) this CyNetwork should be saved.
|
CyTable |
getTable(Class<? extends CyIdentifiable> type,
String namespace)
Returns the table with the specified namespace and type from this
network.
|
boolean |
removeEdges(Collection<CyEdge> edges)
Remove an edge from the network and delete the edge (if it only exists in
this network).
|
boolean |
removeNodes(Collection<CyNode> node)
Remove a node from the network and delete the node (if it only exists in
this network).
|
getSUID
dispose
static final String SELECTED
static final String DEFAULT_ATTRS
CyTableManager
for more information.
The table should be referenced using this constant:
CyNetwork.DEFAULT_ATTRS
.static final String LOCAL_ATTRS
CyTableManager
for more information.
The table should be referenced using this constant:
CyNetwork.DEFAULT_ATTRS
.static final String HIDDEN_ATTRS
CyTableManager
for more information.static final String NAME
CyNode addNode()
boolean removeNodes(Collection<CyNode> node)
CyRootNetwork
for information about having the same node in two networks.
network.removeNodes(Collections.singletonList(node));
node
- the node to be deletedCyEdge addEdge(CyNode source, CyNode target, boolean isDirected)
source
- the source (or start) of the edgetarget
- the target (or end) of the edgeisDirected
- if 'true' this is a directed edgeboolean removeEdges(Collection<CyEdge> edges)
CyRootNetwork
for information about having the same edge in two networks.
network.removeEdges(Collections.singletonList(edge));
edges
- the edges to be deletedint getNodeCount()
int getEdgeCount()
List<CyNode> getNodeList()
List<CyEdge> getEdgeList()
boolean containsNode(CyNode node)
node
- the node to checkboolean containsEdge(CyEdge edge)
edge
- the edge to checkboolean containsEdge(CyNode from, CyNode to)
from
- the source of the edgeto
- the target of the edgeCyNode getNode(long suid)
suid
- the SUID of the CyNode to getCyEdge getEdge(long suid)
suid
- the SUID of the CyEdge to getList<CyNode> getNeighborList(CyNode node, CyEdge.Type edgeType)
CyEdge.Type
enum is
used to determine whether the list includes undirected, directed,
incoming, or outgoing edges. The list will be empty if there
are no neighbor nodes found.
This method should never return null.
Modifying this list (if allowed by the implementation)
has no effect on the network. This method only returns immediate
neighbors.node
- the node whose neighbors we're looking foredgeType
- the directionality of the edges we're interested inList<CyEdge> getAdjacentEdgeList(CyNode node, CyEdge.Type edgeType)
CyEdge.Type
enum is
used to determine whether the list includes undirected, directed,
incoming, or outgoing edges. The list will be empty if there are
no adjacent edges found.
This method should never return null.
Modifying this list (if allowed by the implementation)
has no effect on the network.node
- the node whose edges we're looking foredgeType
- the directionality of the edges we're interested inIterable<CyEdge> getAdjacentEdgeIterable(CyNode node, CyEdge.Type edgeType)
CyEdge.Type
enum is
used to determine whether the list includes undirected, directed,
incoming, or outgoing edges. The iterable will be empty if there are
no adjacent edges found.
This method should never return null.
Modifying this list (if allowed by the implementation)
has no effect on the network.
The Iterable implementation may be more efficient because it doesn't
necessarily need to create a list first. However, that depends on implementation
details, so you should evaluate the method performance yourself.node
- the node whose edges we're looking foredgeType
- the directionality of the edges we're interested inList<CyEdge> getConnectingEdgeList(CyNode source, CyNode target, CyEdge.Type edgeType)
CyEdge.Type
enum is
used to determine whether the list includes undirected, directed,
incoming, or outgoing edges. The list will be empty if no connecting
edges are found.
This method should never return null. This method will NOT find the
shortest path between two nodes that are not already immediate neighbors.
Modifying this list (if allowed by the implementation)
has no effect on the network.source
- the source nodetarget
- the target nodeedgeType
- the directionality of the edges we're interested inCyTable getDefaultNetworkTable()
CyNetworkTableManager.getTableMap(this,CyNetwork.class,CyNetwork.DEFAULT_ATTRS);
CyTable getDefaultNodeTable()
CyNetworkTableManager.getTable(this,CyNode.class,CyNetwork.DEFAULT_ATTRS);
CyTable getDefaultEdgeTable()
CyNetworkTableManager.getTableMap(this,CyEdge.class,CyNetwork.DEFAULT_ATTRS);
CyTable getTable(Class<? extends CyIdentifiable> type, String namespace)
type
- Type of CyIdentifiable
associated with the table.namespace
- the namespace
the table should belong to.CyRow getRow(CyIdentifiable entry, String namespace)
entry
- The entry (node, edge, network) whose row we're looking for.namespace
- the namespace
of the table from which to extract the row.CyRow getRow(CyIdentifiable entry)
DEFAULT_ATTRS
).
A null entry or a
an entry not found in this network will return null.entry
- The entry (node, edge, network) whose row we're looking for.SavePolicy getSavePolicy()
Copyright 2011-2015 Cytoscape Consortium. All rights reserved.