|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Edge
A general purpose class that provides methods for the management of edges in a graph.
complexity
tag.
Method Summary | ||
---|---|---|
|
getNode0()
First node of the edge. |
|
|
getNode1()
Second node of the edge. |
|
|
getOpposite(Node node)
When knowing one node and one edge of this node, this method return the node at the other end of the edge. |
|
|
getSourceNode()
Start node. |
|
|
getTargetNode()
End node. |
|
boolean |
isDirected()
Is the edge directed ?. |
|
boolean |
isLoop()
Does the source and target of this edge identify the same node ?. |
Methods inherited from interface org.graphstream.graph.Element |
---|
addAttribute, addAttributes, changeAttribute, clearAttributes, getArray, getAttribute, getAttribute, getAttributeCount, getAttributeKeyIterator, getAttributeKeySet, getFirstAttributeOf, getFirstAttributeOf, getHash, getId, getIndex, getLabel, getNumber, getVector, hasArray, hasAttribute, hasAttribute, hasHash, hasLabel, hasNumber, hasVector, removeAttribute, setAttribute |
Method Detail |
---|
boolean isDirected()
boolean isLoop()
<T extends Node> T getNode0()
This is equivalent to the getSourceNode()
method, but may be
clearer in the source code if the graph you are using is not directed.
This method is implicitly generic and return something which extends Node. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedNode n = edge.getNode0();the method will return an ExtendedNode. If no left part exists, method will just return a Node.
getNode1()
,
getSourceNode()
<T extends Node> T getNode1()
This is equivalent to the getTargetNode()
method, but may be
clearer in the source code if the graph you are using is not directed.
This method is implicitly generic and return something which extends Node. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedNode n = edge.getNode1();the method will return an ExtendedNode. If no left part exists, method will just return a Node.
getNode0()
,
getTargetNode()
<T extends Node> T getSourceNode()
When the edge is directed this is the source node, in this case you can
get the opposite node using getTargetNode()
. This is equivalent
to the getNode0()
method but may be clearer in the source code
if the graph you are using is directed.
This method is implicitly generic and return something which extends Node. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedNode n = edge.getSourceNode();the method will return an ExtendedNode. If no left part exists, method will just return a Node.
getNode0()
,
getTargetNode()
<T extends Node> T getTargetNode()
When the edge is directed this is the target node, in this case you can
get the opposite node using getSourceNode()
. This is equivalent
to the getNode1()
method but may be clearer in the source code
if the graph you are using is directed.
This method is implicitly generic and return something which extends Node. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedNode n = edge.getTargetNode();the method will return an ExtendedNode. If no left part exists, method will just return a Node.
getNode1()
,
getSourceNode()
<T extends Node> T getOpposite(Node node)
Return null if the given node is not at any end of the edge.
This method is implicitly generic and return something which extends Node. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedNode n = edge.getOppositeNode((ExtendedNode) m);the method will return an ExtendedNode. If no left part exists, method will just return a Node.
node
- The node we search the opposite of.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |