|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object State
public class State
This class represents a single state vertex in a graph of states.
Constructor Summary | |
---|---|
State(java.lang.String name)
Construct a vertex. |
Method Summary | |
---|---|
void |
addNeighbor(State neighbor)
Add a neighbor to the adjacency list for this vertex. |
java.lang.String |
getName()
Return the name associated with this vertex. |
java.util.ArrayList<State> |
getNeighbors()
Return the adjacency list for this vertex. |
boolean |
isVisited()
Check to see if the current vertex has been visited. |
void |
setVisited(boolean visited)
Set or un-set the visited flag for this vertex. |
java.lang.String |
toString()
Convert the vertex to a string (just return the name.) |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public State(java.lang.String name)
name
- The name associated with this vertex.Method Detail |
---|
public void addNeighbor(State neighbor)
neighbor
- A vertex to add to the adjacency list.public java.util.ArrayList<State> getNeighbors()
public boolean isVisited()
public void setVisited(boolean visited)
visited
- New value for the visited flag.public java.lang.String getName()
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 |