Plexus v0.13.1

com.phoenixst.plexus.util
Class DefaultSimpleEdge

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

public class DefaultSimpleEdge
extends DefaultEdge

A default Graph.Edge implementation for a simple graph in which the user-defined object must be null. This class should only be used by Graphs which create edges lazily on demand. Otherwise, use DefaultEdge or DefaultObjectEdge instead. Reference equality is not used by equals( Object ).

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

Constructor Summary
DefaultSimpleEdge(Object tail, Object head, boolean directed)
          Creates a new DefaultSimpleEdge.
 
Method Summary
 boolean equals(Object object)
          Returns whether or not some other object is equal to this one.
 int hashCode()
          Returns the hash code for this Graph.Edge.
 
Methods inherited from class com.phoenixst.plexus.util.DefaultEdge
getHead, getOtherEndpoint, getTail, getUserObject, isDirected, setUserObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultSimpleEdge

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

Method Detail

equals

public boolean equals(Object object)
Description copied from interface: Graph.Edge
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

Specified by:
equals in interface Graph.Edge
Overrides:
equals in class Object

hashCode

public int hashCode()
Description copied from interface: Graph.Edge
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

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