public interface Path
extends java.lang.Cloneable
Graph as defined by a Traverser.
In abstraction, any Path implementation maintains two lists: a list of sets of labels and a list of objects.
The list of labels are the labels of the steps traversed.
The list of objects are the objects traversed.| Modifier and Type | Interface and Description |
|---|---|
static class |
Path.Exceptions |
| Modifier and Type | Method and Description |
|---|---|
void |
addLabel(java.lang.String label)
Add label to the current head of the path.
|
Path |
clone() |
Path |
extend(java.lang.Object object,
java.lang.String... labels)
Add a new step to the path with an object and any number of associated labels.
|
default void |
forEach(java.util.function.BiConsumer<java.lang.Object,java.util.Set<java.lang.String>> consumer) |
default void |
forEach(java.util.function.Consumer<java.lang.Object> consumer) |
default <A> A |
get(int index)
Get the object associated with the specified index into the path.
|
default <A> A |
get(java.lang.String label)
Get the object associated with the particular label of the path.
|
default boolean |
hasLabel(java.lang.String label)
Return true if the path has the specified label, else return false.
|
default boolean |
isSimple()
Determines whether the path is a simple or not.
|
java.util.List<java.util.Set<java.lang.String>> |
labels()
An ordered list of the labels associated with the path
|
java.util.List<java.lang.Object> |
objects()
An ordered list of the objects in the path.
|
default int |
size()
Get the number of step in the path.
|
default java.util.stream.Stream<org.javatuples.Pair<java.lang.Object,java.util.Set<java.lang.String>>> |
stream() |
default int size()
Path extend(java.lang.Object object, java.lang.String... labels)
object - the new head of the pathlabels - the labels at the head of the pathdefault <A> A get(java.lang.String label)
throws java.lang.IllegalArgumentException
List of those objects.A - the type of the object associated with the labellabel - the label of the pathjava.lang.IllegalArgumentException - if the path does not contain the labeldefault <A> A get(int index)
A - the type of the object associated with the indexindex - the index of the pathdefault boolean hasLabel(java.lang.String label)
label - the label to search forvoid addLabel(java.lang.String label)
label - the label to add to the head of the pathjava.util.List<java.lang.Object> objects()
java.util.List<java.util.Set<java.lang.String>> labels()
Path clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedExceptiondefault boolean isSimple()
default void forEach(java.util.function.Consumer<java.lang.Object> consumer)
default void forEach(java.util.function.BiConsumer<java.lang.Object,java.util.Set<java.lang.String>> consumer)
default java.util.stream.Stream<org.javatuples.Pair<java.lang.Object,java.util.Set<java.lang.String>>> stream()
Copyright © 2013-2015 TinkerPop. All Rights Reserved.