public class Path<L extends java.lang.Comparable<L>,V> extends java.lang.Object implements java.lang.Iterable<Vertex<L,V>>
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<V> |
payload |
protected java.util.List<Vertex<L,V>> |
vertices |
Constructor and Description |
---|
Path(Path<L,V> p)
Creates a path by copying the vertices from an existing path.
|
Path(java.util.Set<V> payload,
Vertex<L,V>... vertices)
Create a Path with payload(s) and number of vertices pre-populated.
|
Path(Vertex<L,V>... vertices)
Create a Path with a number of vertices pre-populated.
|
Path(V payload,
Vertex<L,V>... vertices)
Create a Path with a single payload and number of vertices pre-populated.
|
Modifier and Type | Method and Description |
---|---|
void |
add(L label) |
void |
add(L label,
V value) |
void |
add(Vertex<L,V> vertex) |
void |
addPayload(V payload) |
Vertex<L,V> |
get(int index) |
java.util.List<L> |
getLabels()
Retrieve a list of the
Vertex labels in this Path. |
java.util.Set<V> |
getPayload() |
Vertex<L,V> |
getTail() |
java.util.List<Vertex<L,V>> |
getVertices() |
boolean |
hasPayload() |
java.util.Iterator<Vertex<L,V>> |
iterator() |
void |
remove(int index) |
boolean |
remove(Vertex<L,V> vertex) |
void |
setPayload(java.util.Set<V> payload) |
int |
size()
Retrieves the number of
Vertex instances in this Path. |
void |
sort(java.util.Comparator<? super Vertex<L,V>> c) |
java.lang.String |
toString() |
protected java.util.Set<V> payload
@SafeVarargs public Path(Vertex<L,V>... vertices)
@SafeVarargs public Path(V payload, Vertex<L,V>... vertices)
@SafeVarargs public Path(java.util.Set<V> payload, Vertex<L,V>... vertices)
public int size()
Vertex
instances in this Path.public void add(L label)
public void remove(int index)
public java.util.Set<V> getPayload()
public void setPayload(java.util.Set<V> payload)
public void addPayload(V payload)
public boolean hasPayload()
public java.lang.String toString()
toString
in class java.lang.Object