public class DefaultEdge extends Object implements Graph.Edge, Serializable
Graph.Edge
implementation
in which the user-defined object must be null
. The
equals()
method is inherited from
Object
and uses reference equality. This class
should only be used by Graphs
which create edges once
and store them.Constructor and Description |
---|
DefaultEdge(Object tail,
Object head,
boolean directed)
Creates a new
DefaultEdge . |
Modifier and Type | Method and Description |
---|---|
Object |
getHead()
Returns the node which is the head of this
Graph.Edge . |
Object |
getOtherEndpoint(Object node)
Returns the node which is at the other end of this
Graph.Edge than the specified node. |
Object |
getTail()
Returns the node which is the tail of this
Graph.Edge . |
Object |
getUserObject()
Returns the user object contained in this
Graph.Edge . |
boolean |
isDirected()
Returns whether or not this
Graph.Edge is
directed. |
void |
setUserObject(Object object)
Sets the user object contained in this
Graph.Edge . |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode
public boolean isDirected()
Graph.Edge
Graph.Edge
is
directed.isDirected
in interface Graph.Edge
Graph.Edge
is
directed.public Object getUserObject()
Graph.Edge
Graph.Edge
.getUserObject
in interface Graph.Edge
Graph.Edge
.public void setUserObject(Object object)
Graph.Edge
Graph.Edge
.setUserObject
in interface Graph.Edge
object
- the user object to replace the one in this
Graph.Edge
.public Object getTail()
Graph.Edge
Graph.Edge
.getTail
in interface Graph.Edge
Graph.Edge
.public Object getHead()
Graph.Edge
Graph.Edge
.getHead
in interface Graph.Edge
Graph.Edge
.public Object getOtherEndpoint(Object node)
Graph.Edge
Graph.Edge
than the specified node.getOtherEndpoint
in interface Graph.Edge
node
- the node which is the endpoint of this
Graph.Edge
not to return.Graph.Edge
than the specified node.See the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.