|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnick.graph.GraphElement<E>
public abstract class GraphElement<E>
This abstract class is designed to be extended by classes that are elements of a graph. Vertices and edges are two obvious graph elements. Some basic accessor and mutator methods are provided. Note that in a generic graph element that the data is listed before the name in a constructor. Children may or may not follow this convention.
Constructor Summary | |
---|---|
GraphElement(E the_data)
Construct a new GraphElement object. |
|
GraphElement(E the_data,
java.lang.String the_name)
Construct a new GraphElement object. |
Method Summary | |
---|---|
E |
data()
|
java.lang.String |
name()
|
void |
setData(E the_data)
Change the data associated with this GraphElement. |
void |
setName(java.lang.String the_name)
Rename this GraphElement. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GraphElement(E the_data)
the_data
- Set the data of this GraphElement.public GraphElement(E the_data, java.lang.String the_name)
the_data
- Set the data of this GraphElement.the_name
- Set the name of this GraphElement.Method Detail |
---|
public void setName(java.lang.String the_name)
the_name
- The name to use to replace the old name.public void setData(E the_data)
the_data
- Reset the data associated with this object.public java.lang.String name()
public E data()
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 |