Plexus v0.13.1

com.phoenixst.plexus.util
Class DefaultEdge

java.lang.Object
  extended by com.phoenixst.plexus.util.DefaultEdge
All Implemented Interfaces:
Graph.Edge, Serializable
Direct Known Subclasses:
DefaultObjectEdge, DefaultSimpleEdge

public class DefaultEdge
extends Object
implements Graph.Edge, Serializable

A default 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.

Since:
1.0
Version:
$Revision: 1.10 $
Author:
Ray A. Conner
See Also:
Serialized Form

Constructor Summary
DefaultEdge(Object tail, Object head, boolean directed)
          Creates a new DefaultEdge.
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.phoenixst.plexus.Graph.Edge
equals, hashCode
 

Constructor Detail

DefaultEdge

public DefaultEdge(Object tail,
                   Object head,
                   boolean directed)
Creates a new DefaultEdge.

Method Detail

isDirected

public boolean isDirected()
Description copied from interface: Graph.Edge
Returns whether or not this Graph.Edge is directed.

Specified by:
isDirected in interface Graph.Edge
Returns:
whether or not this Graph.Edge is directed.

getUserObject

public Object getUserObject()
Description copied from interface: Graph.Edge
Returns the user object contained in this Graph.Edge.

Specified by:
getUserObject in interface Graph.Edge
Returns:
the user object contained in this Graph.Edge.

setUserObject

public void setUserObject(Object object)
Description copied from interface: Graph.Edge
Sets the user object contained in this Graph.Edge.

Specified by:
setUserObject in interface Graph.Edge
Parameters:
object - the user object to replace the one in this Graph.Edge.

getTail

public Object getTail()
Description copied from interface: Graph.Edge
Returns the node which is the tail of this Graph.Edge.

Specified by:
getTail in interface Graph.Edge
Returns:
the node which is the tail of this Graph.Edge.

getHead

public Object getHead()
Description copied from interface: Graph.Edge
Returns the node which is the head of this Graph.Edge.

Specified by:
getHead in interface Graph.Edge
Returns:
the node which is the head of this Graph.Edge.

getOtherEndpoint

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

Specified by:
getOtherEndpoint in interface Graph.Edge
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.

toString

public String toString()
Overrides:
toString in class Object

Plexus v0.13.1

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.