salvo.jesus.graph
Class Vertex

java.lang.Object
  extended by salvo.jesus.graph.Vertex
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
NamedVertex

public class Vertex
extends java.lang.Object
implements java.io.Serializable

A vertex in a graph. This class encapsulates an object that the vertex will represent. Hence, a Vertex can represent any object that extends java.lang.Object by simply calling setObject() or specifying the objet on the constructor. Because Vertex.toString() will simply call the object's toString() method, you may want to override the object's toString() method before you assign the object to a Vertex.

Author:
Jesus M. Salvo Jr.
See Also:
Serialized Form

Field Summary
private  java.lang.Object object
          The object that the vertex represents.
 
Constructor Summary
Vertex()
          Constructor that initializes this.object to null
Vertex(java.lang.Object newobject)
          Creates a new Vertex object that initializes this.object to newobject
 
Method Summary
 java.lang.Object getObject()
          Getter method that returns the object that the Vertex represents
 void setObject(java.lang.Object newobject)
          Setter method sets this.object to newobject
 java.lang.String toString()
          Wrapper method that simply calls this.object.toString()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

object

private java.lang.Object object
The object that the vertex represents.

Constructor Detail

Vertex

public Vertex()
Constructor that initializes this.object to null


Vertex

public Vertex(java.lang.Object newobject)
Creates a new Vertex object that initializes this.object to newobject

Parameters:
newobject - The object that the Vertex will encapsulate
Method Detail

getObject

public java.lang.Object getObject()
Getter method that returns the object that the Vertex represents

Returns:
The object that this Vertex encapsulates

setObject

public void setObject(java.lang.Object newobject)
Setter method sets this.object to newobject


toString

public java.lang.String toString()
Wrapper method that simply calls this.object.toString()

Overrides:
toString in class java.lang.Object
Returns:
String representation of the Vertex object