|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectnet.aronnax.CountPaths.Path
public class Path
Class Path represents a trip through several vertices in some order. This version of Path supposes that you already know the maximum number of vertices that will be travelled through. If this isn't true, the class will need modified to dynamically grow the internal array.
Vertex| Constructor Summary | |
|---|---|
Path(int maxPathLength,
Vertex V)
This constructor creates a bare minimum Path: it has a maximum length and a starting Vertex. |
|
Path(int maxPathLength,
Vertex[] vertexPathIn)
This constructor initializes a Path with the vertices passed in the vertexPathIn array and has a size bigger than or equal to the passed array specified by maxPathLength. |
|
Path(Vertex[] vertexPathIn)
This constructor initializes a Path with the vertices passed in the vertexPathIn array and the same array size. |
|
| Method Summary | |
|---|---|
void |
add(Vertex V)
The add method allows one to append a new Vertex to the Path. |
Path |
copyAndAdd(Vertex V)
The copyAndAdd method provides a way to create a copy of the current Path with the addition of a new Vertex at the end. |
Path |
copyPath()
The copyPath method permits one to create an identical Path to the current one. |
boolean |
hasDuplicates()
The hasDuplicates method checks to see if the last Vertex added has created a duplicate Vertex in the Path. |
Vertex |
lastVertex()
The lastVertex method returns the current end of the Path (aka the last Vertex added to the Path). |
int |
length()
The length method returns the number of steps in the current Path. |
java.lang.String |
toString()
The toString method returns a String object that describes the way the Path traverses the various Vertex points. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Path(int maxPathLength,
Vertex V)
maxPathLength - The maximum number of steps in this Path.V - The starting Vertex of this Path.public Path(Vertex[] vertexPathIn)
vertexPathIn - An array of vertices describing a Path. (Need not be completely filled.)
public Path(int maxPathLength,
Vertex[] vertexPathIn)
maxPathLength - The maximum number of steps in this Path. (Should be bigger or equal to the passed array length.)vertexPathIn - An array of vertices describing a Path. (Need not be completely filled.)| Method Detail |
|---|
public void add(Vertex V)
V - The next Vertex in this Path.public Path copyPath()
public Path copyAndAdd(Vertex V)
V - A new Vertex to be added to a copy of the current Path.
public Vertex lastVertex()
public boolean hasDuplicates()
public int length()
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 | |||||||