final class TraversalLogicExt[A] extends AnyVal
- Alphabetic
- By Inheritance
- TraversalLogicExt
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TraversalLogicExt(iterator: Iterator[A])
Type Members
- type Traversal[A] = Iterator[A]
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def and(traversals: (Traversal[A]) => Traversal[_]*): Traversal[A]
only preserves elements for which _all of_ the given traversals have at least one result Works for arbitrary amount of 'AND' traversals.
only preserves elements for which _all of_ the given traversals have at least one result Works for arbitrary amount of 'AND' traversals.
- Annotations
- @Doc()
.and(_.label("someLabel"), _.has("someProperty"))
Example: - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def choose[BranchOn >: Null, NewEnd](on: (Traversal[A]) => Traversal[BranchOn])(options: PartialFunction[BranchOn, (Traversal[A]) => Traversal[NewEnd]]): Traversal[NewEnd]
Branch step: based on the current element, match on something given a traversal, and provide resulting traversals based on the matched element.
Branch step: based on the current element, match on something given a traversal, and provide resulting traversals based on the matched element. Allows to implement conditional semantics: if, if/else, if/elseif, if/elseif/else, ...
- BranchOn
required to be >: Null because the implementation is using
null
as the default value. I didn't find a better way to implement all semantics with the niceties of PartialFunction, and also yolo...- NewEnd
The element type of the resulting traversal
- on
Traversal to get to what you want to match on
- options
PartialFunction from the matched element to the resulting traversal
- Annotations
- @Doc()
.choose(_.property(Name)) { case "L1" => _.out case "R1" => _.repeat(_.out)(_.maxDepth(3)) case _ => _.in }
- See also
LogicalStepsTests
Example: - def coalesce[NewEnd](options: (Traversal[A]) => Traversal[NewEnd]*): Traversal[NewEnd]
- Annotations
- @Doc()
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val iterator: Iterator[A]
- def not(trav: (Traversal[A]) => Traversal[_]): Traversal[A]
only preserves elements if the provided traversal does _not_ have any results - alias for whereNot
only preserves elements if the provided traversal does _not_ have any results - alias for whereNot
- Annotations
- @Doc()
- def or(traversals: (Traversal[A]) => Traversal[_]*): Traversal[A]
only preserves elements for which _at least one of_ the given traversals has at least one result Works for arbitrary amount of 'OR' traversals.
only preserves elements for which _at least one of_ the given traversals has at least one result Works for arbitrary amount of 'OR' traversals.
- Annotations
- @Doc()
.or(_.label("someLabel"), _.has("someProperty"))
Example: - def sideEffect(fun: Function1[A, _]): Traversal[A]
perform side effect without changing the contents of the traversal
perform side effect without changing the contents of the traversal
- Annotations
- @Doc()
- def sideEffectPF(pf: PartialFunction[A, _]): Traversal[A]
perform side effect without changing the contents of the traversal will only apply the partialFunction if it is defined for the given input - analogous to
collect
perform side effect without changing the contents of the traversal will only apply the partialFunction if it is defined for the given input - analogous to
collect
- Annotations
- @Doc()
- def toString(): String
- Definition Classes
- Any
- def union[B](traversals: (Traversal[A]) => Traversal[B]*): Traversal[B]
union step from the current point
union step from the current point
- traversals
to be executed from here, results are being aggregated/summed/unioned
- Annotations
- @Doc()
.union(_.out, _.in)
Example: - def where(trav: (Traversal[A]) => Traversal[_]): Traversal[A]
only preserves elements if the provided traversal has at least one result
only preserves elements if the provided traversal has at least one result
- Annotations
- @Doc()
- def whereNot(trav: (Traversal[A]) => Traversal[_]): Traversal[A]
only preserves elements if the provided traversal does _not_ have any results
only preserves elements if the provided traversal does _not_ have any results
- Annotations
- @Doc()