package graph;
/**
* A simple implementation of the Vertex interface.
* @author tcolburn
*/
public class SimpleVertex implements Vertex {
/**
* Constructs a simple vertex.
* @param name The vertex name
*/
public SimpleVertex(String name) {
this.name = name;
}
/**
* Accessor for this vertex's name.
* @return The vertex name
*/
public String getName() {
return name;
}
/**
* The string representation for a simple vertex is simply its name.
* @return The vertex name
*/
public String toString() {
return getName();
}
/**
* The name of this vertex
*/
private String name;
}