net.xqhs.graphs.representation.text
Class SettableEdge
java.lang.Object
net.xqhs.graphs.representation.AbstractVisualizableGraphComponent
net.xqhs.graphs.graph.SimpleEdge
net.xqhs.graphs.representation.text.SettableEdge
- All Implemented Interfaces:
- Edge, GraphComponent, VisualizableGraphComponent
class SettableEdge
- extends SimpleEdge
A utility class that allows the from and to nodes to be set separately. It is meant to be converted to
a SimpleEdge
after setting both ends.
IMPORTANT: this edge should not be added to a graph before setting both adjacent nodes (or better, it should always
be converted through the toSimpleEdge()
method).
- Author:
- Andrei Olaru
Constructor Summary |
protected |
SettableEdge(java.lang.String label)
Constructs an Edge instance with the adjacent nodes not set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SettableEdge
protected SettableEdge(java.lang.String label)
- Constructs an
Edge
instance with the adjacent nodes not set.
- Parameters:
label
- : the label of the edge.
setFrom
protected SettableEdge setFrom(Node sourceNode)
- Parameters:
sourceNode
- : the source node.
- Returns:
- the instance itself.
setTo
protected SettableEdge setTo(Node destinationNode)
- Parameters:
destinationNode
- : the destination node.
- Returns:
- the instance itself.
toSimpleEdge
protected SimpleEdge toSimpleEdge()
- Transfers the parameters of the current instance to a new
SimpleEdge
instance.
- Returns:
- the newly created
SimpleEdge
instance, with the same label and from and to nodes.