Graph
Class Path
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.AbstractSequentialList
|
+--java.util.LinkedList
|
+--Graph.Path
- public class Path
- extends LinkedList
Represents a path...in this case, the connections between cities.
Could be generalized.
- See Also:
- Serialized Form
|
Constructor Summary |
Path(Vertex start)
The only constructor. |
| Methods inherited from class java.util.LinkedList |
add,
add,
addAll,
addAll,
addBefore,
addFirst,
addLast,
clear,
clone,
contains,
entry,
get,
getFirst,
getLast,
indexOf,
lastIndexOf,
listIterator,
readObject,
remove,
remove,
remove,
removeFirst,
removeLast,
set,
size,
toArray,
toArray,
writeObject |
start
Vertex start
Path
public Path(Vertex start)
- The only constructor. The smallest path is a single vertex.
addEdge
public void addEdge(Vertex start,
Edge e)
- Add an edge to the start of the path.
toString
public String toString()
- Overrides:
- toString in class AbstractCollection