public class State
extends java.lang.Object
Constructor and Description |
---|
State(java.lang.String name)
Construct a vertex.
|
Modifier and Type | Method and Description |
---|---|
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).
|
public State(java.lang.String name)
name
- The name associated with this vertex.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