Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.phoenixst.plexus
Class SimpleObjectEdge  view SimpleObjectEdge download SimpleObjectEdge.java

java.lang.Object
  extended bycom.phoenixst.plexus.SimpleEdge
      extended bycom.phoenixst.plexus.SimpleObjectEdge
All Implemented Interfaces:
Graph.Edge, java.io.Serializable

public class SimpleObjectEdge
extends SimpleEdge

A SimpleEdge which can contain a user-defined object. Because of how equals( Object ) 55 is defined, instances of this class may only be used by multigraphs when the endpoints and contained user-defined object are sufficient to distinguish distinct edges.

Since:
1.0
Version:
$Revision: 1.1 $

Field Summary
private  java.lang.Object object
          The object contained by this Edge.
 
Fields inherited from class com.phoenixst.plexus.SimpleEdge
 
Constructor Summary
SimpleObjectEdge(Graph graph, java.lang.Object object, java.lang.Object tail, java.lang.Object head, boolean isDirected)
          Creates a new SimpleObjectEdge.
 
Method Summary
 boolean equals(java.lang.Object object)
          Two SimpleObjectEdges are equal if they have the same directedness, are from the exact same graph (using ==), have equal endpoints, and contain the same user-defined object.
 boolean equals(SimpleEdge edge)
          Two SimpleObjectEdges are equal if they have the same directedness, are from the exact same graph (using ==), have equal endpoints, and contain the same user-defined object.
 java.lang.Object getUserObject()
          Returns the user object contained in this Edge.
 int hashCode()
          Returns the hash code for this Edge.
 void setUserObject(java.lang.Object object)
          Sets the user object contained in this Edge.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class com.phoenixst.plexus.SimpleEdge
equals, getHead, getOtherEndpoint, getTail, isDirected
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

object

private java.lang.Object object
The object contained by this Edge.

Constructor Detail

SimpleObjectEdge

public SimpleObjectEdge(Graph graph,
                        java.lang.Object object,
                        java.lang.Object tail,
                        java.lang.Object head,
                        boolean isDirected)
Creates a new SimpleObjectEdge.

Method Detail

getUserObject

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

Specified by:
getUserObject in interface Graph.Edge
Overrides:
getUserObject in class SimpleEdge

setUserObject

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

Specified by:
setUserObject in interface Graph.Edge
Overrides:
setUserObject in class SimpleEdge

equals

public boolean equals(java.lang.Object object)
Two SimpleObjectEdges are equal if they have the same directedness, are from the exact same graph (using ==), have equal endpoints, and contain the same user-defined object.

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

equals

public boolean equals(SimpleEdge edge)
Two SimpleObjectEdges are equal if they have the same directedness, are from the exact same graph (using ==), have equal endpoints, and contain the same user-defined object.

Overrides:
equals in class SimpleEdge

hashCode

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

Description copied from class: java.lang.Object
null

Specified by:
hashCode in interface Graph.Edge
Overrides:
hashCode in class SimpleEdge

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).

Overrides:
toString in class SimpleEdge