|
Cytoscape 3.0.0-beta1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CyNetwork
CyNetwork is the primary interface for representing a network (graph) data structure in Cytoscape. Specifically, CyNetwork represents a multi-graph as multiple edges may exist between nodes. Edges may be directed, undirected, or both.
Field Summary | |
---|---|
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 |
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. |
Fields inherited from interface org.cytoscape.model.CyIdentifiable |
---|
SUID |
Method Summary | |
---|---|
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 index)
Return the CyEdge that has the index. |
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 index)
Return the CyNode that has the index. |
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 tableName)
Returns the row for the specified table name for this object. |
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). |
Methods inherited from interface org.cytoscape.model.CyIdentifiable |
---|
getSUID |
Field Detail |
---|
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 HIDDEN_ATTRS
CyTableManager
for more information.
static final String NAME
Method Detail |
---|
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 deleted
CyEdge 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 edge
boolean 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 deleted
int getNodeCount()
int getEdgeCount()
List<CyNode> getNodeList()
List<CyEdge> getEdgeList()
boolean containsNode(CyNode node)
node
- the node to check
boolean containsEdge(CyEdge edge)
edge
- the edge to check
boolean containsEdge(CyNode from, CyNode to)
from
- the source of the edgeto
- the target of the edge
CyNode getNode(long index)
index
- the index of the CyNode to get
CyEdge getEdge(long index)
index
- the index of the CyEdge to get
List<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 in
List<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 in
Iterable<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 in
List<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 in
CyTable 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);
CyRow getRow(CyIdentifiable entry, String tableName)
entry
- The entry (node, edge, network) whose row we're looking for.tableName
- the name 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.
|
Cytoscape 3.0.0-beta1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |