|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsalvo.jesus.graph.Vertex
public class Vertex
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.
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 |
---|
private java.lang.Object object
Constructor Detail |
---|
public Vertex()
public Vertex(java.lang.Object newobject)
newobject
- The object that the Vertex will encapsulateMethod Detail |
---|
public java.lang.Object getObject()
public void setObject(java.lang.Object newobject)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |