com.phoenixst.plexus

Interface Graph.Edge

public static interface Graph.Edge

An interface describing an edge in a Graph. Please see equals( Object ) for important information on implementing this interface.
Method Summary
booleanequals(Object object)
Returns whether or not some other object is equal to this one.
ObjectgetHead()
Returns the node which is the head of this Graph.Edge.
ObjectgetOtherEndpoint(Object node)
Returns the node which is at the other end of this Graph.Edge than the specified node.
ObjectgetTail()
Returns the node which is the tail of this Graph.Edge.
ObjectgetUserObject()
Returns the user object contained in this Graph.Edge.
inthashCode()
Returns the hash code for this Graph.Edge.
booleanisDirected()
Returns whether or not this Graph.Edge is directed.
voidsetUserObject(Object object)
Sets the user object contained in this Graph.Edge.

Method Detail

equals

public boolean equals(Object object)
Returns whether or not some other object is equal to this one. It is vitally important that two Graph.Edges only be .equals() when they refer to the same actual edge in the graph. Which edge this is does not change when the contained user-defined object changes. In a multigraph, the endpoints and contained user-defined object are generally not sufficiently distinguishing characteristics. Accepting the default implementation from Object, which uses reference equality, should be preferred unless Graph.Edges are lazily created on demand.

Description copied from class: Object
{@inheritDoc }

getHead

public Object getHead()
Returns the node which is the head of this Graph.Edge.

Returns: the node which is the head of this Graph.Edge.

getOtherEndpoint

public Object getOtherEndpoint(Object node)
Returns the node which is at the other end of this Graph.Edge than the specified node.

Parameters: node the node which is the endpoint of this Graph.Edge not to return.

Returns: the node which is at the other end of this Graph.Edge than the specified node.

Throws: IllegalArgumentException if this Graph.Edge is not incident on the specified node.

getTail

public Object getTail()
Returns the node which is the tail of this Graph.Edge.

Returns: the node which is the tail of this Graph.Edge.

getUserObject

public Object getUserObject()
Returns the user object contained in this Graph.Edge.

Returns: the user object contained in this Graph.Edge.

hashCode

public int hashCode()
Returns the hash code for this Graph.Edge. Since it is mutable, the contained user-defined object should not be used when computing the hash code.

Description copied from class: Object
{@inheritDoc }

isDirected

public boolean isDirected()
Returns whether or not this Graph.Edge is directed.

Returns: whether or not this Graph.Edge is directed.

setUserObject

public void setUserObject(Object object)
Sets the user object contained in this Graph.Edge.

Parameters: object the user object to replace the one in this Graph.Edge.

Throws: ClassCastException if the class of object prevents it from being added to the Graph containing this Graph.Edge. IllegalArgumentException if some aspect of object prevents it from being added to the Graph containing this Graph.Edge. IllegalArgumentException if object is null and the Graph containing this Graph.Edge does not not permit null edges. UnsupportedOperationException if this method is not supported by this Graph.Edge.

See the Plexus project home, hosted by SourceForge.
Copyright B) 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.