public class ImmutablePath extends Object implements Path, Serializable, Cloneable
Path.Exceptions
Modifier | Constructor and Description |
---|---|
protected |
ImmutablePath() |
Modifier and Type | Method and Description |
---|---|
ImmutablePath |
clone() |
boolean |
equals(Object other) |
Path |
extend(Object object,
Set<String> labels)
Add a new step to the path with an object and any number of associated labels.
|
Path |
extend(Set<String> labels)
Add labels to the head of the path.
|
<A> A |
get(int index)
Get the object associated with the specified index into the path.
|
<A> A |
get(Pop pop,
String label)
Pop the object(s) associated with the label of the path.
|
<A> A |
getSingleHead(String label)
Get the object least recently associated with the particular label of the path.
|
<A> A |
getSingleTail(String label)
Get the object most recently associated with the particular label of the path.
|
int |
hashCode() |
boolean |
hasLabel(String label)
Return true if the path has the specified label, else return false.
|
List<Set<String>> |
labels()
An ordered list of the labels associated with the path
The set of labels for a particular step are ordered by the order in which
Path.extend(Object, Set) was called. |
static Path |
make() |
List<Object> |
objects()
An ordered list of the objects in the path.
|
int |
size()
Get the number of step in the path.
|
String |
toString() |
finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, get, isSimple, iterator, popEquals, stream
forEach, spliterator
public static Path make()
public ImmutablePath clone()
public int size()
Path
public Path extend(Object object, Set<String> labels)
Path
public Path extend(Set<String> labels)
Path
public <A> A get(int index)
Path
public <A> A getSingleHead(String label)
A
- the type of the object associated with the labellabel
- the label of the pathpublic <A> A getSingleTail(String label)
A
- the type of the object associated with the labellabel
- the label of the pathpublic <A> A get(Pop pop, String label)
Path
public boolean hasLabel(String label)
Path
public List<Object> objects()
Path
public List<Set<String>> labels()
Path
Path.extend(Object, Set)
was called.Copyright © 2013–2016 Apache Software Foundation. All rights reserved.