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

Quick Search    Search Deep

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

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

public class DefaultEdge
extends java.lang.Object
implements Graph.Edge, java.io.Serializable

A default Graph.Edge implementation in which the user-defined object must be null. The equals() 55 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.6 $

Field Summary
protected  java.lang.Object head
          The head of this Edge.
protected  boolean isDirected
          Whether or not this Edge is directed.
protected  java.lang.Object tail
          The tail of this Edge.
 
Constructor Summary
DefaultEdge(java.lang.Object tail, java.lang.Object head, boolean isDirected)
          Creates a new DefaultEdge.
 
Method Summary
protected static boolean equals(java.lang.Object a, java.lang.Object b)
           
 java.lang.Object getHead()
          Returns the node which is the head of this Edge.
 java.lang.Object getOtherEndpoint(java.lang.Object node)
          Returns the node which is at the other end of this Edge than the specified node.
 java.lang.Object getTail()
          Returns the node which is the tail of this Edge.
 java.lang.Object getUserObject()
          Returns the user object contained in this Edge.
 boolean isDirected()
          Returns whether or not this Edge is directed.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.phoenixst.plexus.Graph.Edge
equals, hashCode
 

Field Detail

tail

protected java.lang.Object tail
The tail of this Edge.


head

protected java.lang.Object head
The head of this Edge.


isDirected

protected boolean isDirected
Whether or not this Edge is directed.

Constructor Detail

DefaultEdge

public DefaultEdge(java.lang.Object tail,
                   java.lang.Object head,
                   boolean isDirected)
Creates a new DefaultEdge.

Method Detail

isDirected

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

Specified by:
isDirected in interface Graph.Edge

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

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

getTail

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

Specified by:
getTail in interface Graph.Edge

getHead

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

Specified by:
getHead in interface Graph.Edge

getOtherEndpoint

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

Specified by:
getOtherEndpoint in interface Graph.Edge

equals

protected static final boolean equals(java.lang.Object a,
                                      java.lang.Object b)

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()).