Interface Edge
- All Superinterfaces:
Element
- All Known Implementing Classes:
AbstractEdge,GraphicEdge
public interface Edge extends Element
Important
Implementing classes may indicate the complexity of their implementation of the methods with thecomplexity tag.- Since:
- July 12 2007
-
Method Summary
Modifier and Type Method Description NodegetNode0()First node of the edge.NodegetNode1()Second node of the edge.NodegetOpposite(Node node)When knowing one node and one edge of this node, this method return the node at the other end of the edge.NodegetSourceNode()Start node.NodegetTargetNode()End node.booleanisDirected()Is the edge directed ?.booleanisLoop()Does the source and target of this edge identify the same node ?.Methods inherited from interface org.graphstream.graph.Element
attributeKeys, clearAttributes, getArray, getAttribute, getAttribute, getAttributeCount, getFirstAttributeOf, getFirstAttributeOf, getId, getIndex, getLabel, getMap, getNumber, getVector, hasArray, hasAttribute, hasAttribute, hasLabel, hasMap, hasNumber, hasVector, removeAttribute, setAttribute, setAttributes
-
Method Details
-
isDirected
boolean isDirected()Is the edge directed ?.- Returns:
- True if the edge is directed.
-
isLoop
boolean isLoop()Does the source and target of this edge identify the same node ?.- Returns:
- True if this edge is a loop.
-
getNode0
Node getNode0()First node of the edge.This is equivalent to the
getSourceNode()method, but may be clearer in the source code if the graph you are using is not directed.- Returns:
- The first node of the edge.
- See Also:
getNode1(),getSourceNode()
-
getNode1
Node getNode1()Second node of the edge.This is equivalent to the
getTargetNode()method, but may be clearer in the source code if the graph you are using is not directed.- Returns:
- The second node of the edge.
- See Also:
getNode0(),getTargetNode()
-
getSourceNode
Node getSourceNode()Start node.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 thegetNode0()method but may be clearer in the source code if the graph you are using is directed.- Returns:
- The origin node of the edge.
- See Also:
getNode0(),getTargetNode()
-
getTargetNode
Node getTargetNode()End node.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 thegetNode1()method but may be clearer in the source code if the graph you are using is directed.- Returns:
- The destination node of the edge.
- See Also:
getNode1(),getSourceNode()
-
getOpposite
When knowing one node and one edge of this node, this method return the node at the other end of the edge.Return null if the given node is not at any end of the edge.
- Parameters:
node- The node we search the opposite of.- Returns:
- the opposite node of the given node.
-