| Constructor and Description |
|---|
Path()
Creates an empty path
|
Path(java.util.List<E> path)
Creates a path given the edges it contains.
|
Path(java.util.List<E> path,
java.util.List<EdgeDirection> directions)
Creates a path given edges and the direction in which they are traversed
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(E e,
EdgeDirection direction)
Adds an edge to the path
|
boolean |
containsDuplicates()
Checks if there is at least one edge which occurs multiple times in
the path's list of edges
|
boolean |
containsEdge(E e)
Checks if the path contains a certain edge
|
java.util.List<EdgeDirection> |
getDirections() |
java.util.List<E> |
getPath() |
java.util.List<V> |
getUniqueVertices() |
boolean |
isCyclic() |
java.util.List<V> |
pathVertices()
Finds all vertices belonging to the path
|
java.util.List<V> |
pathVertivesWithoutDuplicates()
List all vertices on the path, only including one vertex once, even if
it is contained multiple times
|
void |
setDirections(java.util.List<EdgeDirection> directions) |
void |
setPath(java.util.List<E> path) |
int |
size()
Size of the path - number of edges belonging to it
|
java.lang.String |
toString() |
public Path()
public Path(java.util.List<E> path, java.util.List<EdgeDirection> directions)
path - Edges forming the pathsdirections - Directions in which the edges should be traversedpublic Path(java.util.List<E> path)
path - Edges forming the pathpublic void addEdge(E e, EdgeDirection direction)
e - Edgedirection - Direction in which the edge should be traversedpublic boolean containsEdge(E e)
e - Edgetrue if the path contains e, false otherwisepublic java.util.List<E> getPath()
public void setPath(java.util.List<E> path)
path - Edges of the path to setpublic int size()
public boolean isCyclic()
true if the path is cyclic, false otherwisepublic java.util.List<EdgeDirection> getDirections()
public void setDirections(java.util.List<EdgeDirection> directions)
directions - Directions to setpublic boolean containsDuplicates()
true if the path contains duplicates, false otherwisepublic java.util.List<V> pathVertices()
public java.util.List<V> pathVertivesWithoutDuplicates()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List<V> getUniqueVertices()