Interface EdgeTraversal
- All Superinterfaces:
EdgeConditionTraversal
The Graph Traversal that maps
Edge.
This Traversal is lazy, in other words, that just run after any finalizing method.-
Method Summary
Modifier and TypeMethodDescriptionbothV()Converts to vertex traversal taking both incoming and outgoing Vertexlongcount()Map the traversal next to its reduction as a sum of the elementsRemove all duplicates in the traversal stream up to this point.filter(Predicate<EdgeEntity> predicate) Does a filter predicate basedinV()Converts to vertex traversal taking the incoming Vertexlimit(long limit) Filter the objects in the traversal by the number of them to pass through the next, where only the firstnobjects are allowed as defined by thelimitargument.next()Returns the next elements in the traversal.next(int limit) Get the next n elements result as next, the number of elements is limit basedDefines the order of the Edge, the property must have in all elements.outV()Converts to vertex traversal taking the outgoing Vertexrange(long start, long end) Returns an EdgeTraversal with range definedrepeat()Starts the loop traversal graphresult()Concludes the traversal then returns the result as list.Concludes the traversal that returns a singleEdgeEntityresultstream()Get all the result in the traversal as Stream
-
Method Details
-
filter
Does a filter predicate based- Parameters:
predicate- a predicate to apply to each element to determine if it should be included- Returns:
- a with the Vertex predicate
- Throws:
NullPointerException- when predicate is null
-
limit
Filter the objects in the traversal by the number of them to pass through the next, where only the firstnobjects are allowed as defined by thelimitargument.- Parameters:
limit- the number at which to end the next- Returns:
- a with the limit
-
range
Returns an EdgeTraversal with range defined- Parameters:
start- the start inclusiveend- the end exclusive- Returns:
- a with the range set
-
repeat
EdgeRepeatTraversal repeat()Starts the loop traversal graph- Returns:
- a
EdgeRepeatTraversal
-
next
Optional<EdgeEntity> next()Returns the next elements in the traversal. If the traversal is empty, then anOptional.empty()is returned.- Returns:
- the EdgeEntity result otherwise
Optional.empty()
-
singleResult
Optional<EdgeEntity> singleResult()Concludes the traversal that returns a singleEdgeEntityresult- Returns:
- the EdgeEntity result otherwise
Optional.empty()
-
result
Stream<EdgeEntity> result()Concludes the traversal then returns the result as list.- Returns:
- the entities result
-
inV
VertexTraversal inV()Converts to vertex traversal taking the incoming Vertex- Returns:
VertexTraversal
-
outV
VertexTraversal outV()Converts to vertex traversal taking the outgoing Vertex- Returns:
VertexTraversal
-
bothV
VertexTraversal bothV()Converts to vertex traversal taking both incoming and outgoing Vertex- Returns:
VertexTraversal
-
dedup
Remove all duplicates in the traversal stream up to this point.- Parameters:
labels- if labels are provided, then the scoped object's labels determine de-duplication. No labels implies current object.- Returns:
- the traversal with an appended
DedupGlobalStep.
-
stream
Stream<EdgeEntity> stream()Get all the result in the traversal as Stream- Returns:
- the entity result as
Stream
-
next
Get the next n elements result as next, the number of elements is limit based- Parameters:
limit- the limit to result- Returns:
- the entity result as
Stream
-
valueMap
Map theElementto aMapof the properties key'd according to theirProperty.key(). If no property keys are provided, then all properties are retrieved.- Parameters:
propertyKeys- the properties to retrieve- Returns:
- a
ValueMapTraversalinstance
-
orderBy
Defines the order of the Edge, the property must have in all elements. Otherwise, it'll return an exception. As recommendation useEdgeConditionTraversal.has(String)before this method- Parameters:
property- the property to be order- Returns:
- the
EdgeTraversalOrderto define the order way - Throws:
NullPointerException- when the property is nullIllegalStateException- when there any Edge that does not have the property
-
count
long count()Map the traversal next to its reduction as a sum of the elements- Returns:
- the sum
-