PathAwareTraversal

class PathAwareTraversal[A](val elementsWithPath: IterableOnce[(A, Vector[Any])]) extends Traversal[A]
Companion
object
class Traversal[A]
trait IterableFactoryDefaults[A, Traversal]
trait IterableOps[A, Traversal, Traversal[A]]
trait IterableOnceOps[A, Traversal, Traversal[A]]
trait IterableOnce[A]
class Object
trait Matchable
class Any

Value members

Concrete methods

override
def collect[B](pf: PartialFunction[A, B]): Traversal[B]
Definition Classes
IterableOps -> IterableOnceOps
override
Definition Classes
override
def dedupBy(fun: A => Any): Traversal[A]
Definition Classes
override
def filter(pred: A => Boolean): Traversal[A]
Definition Classes
IterableOps -> IterableOnceOps
override
def filterNot(pred: A => Boolean): Traversal[A]
Definition Classes
IterableOps -> IterableOnceOps
override
def flatMap[B](f: A => IterableOnce[B]): Traversal[B]
Definition Classes
IterableOps -> IterableOnceOps
override
def map[B](f: A => B): Traversal[B]
Definition Classes
IterableOps -> IterableOnceOps
override
def path: Traversal[Vector[Any]]
Definition Classes
override
def repeat[B >: A](repeatTraversal: Traversal[A] => Traversal[B])(implicit behaviourBuilder: Builder[B] => Builder[B]): Traversal[B]
Definition Classes
override

Removes all results whose traversal path has repeated objects.

Removes all results whose traversal path has repeated objects.

Definition Classes

Inherited methods

@inline
final
def ++[B >: A](suffix: IterableOnce[B]): Traversal[B]
Inherited from
IterableOps
@inline
final
def addString(b: StringBuilder): StringBuilder
Inherited from
IterableOnceOps
@inline
final
def addString(b: StringBuilder, sep: String): StringBuilder
Inherited from
IterableOnceOps
def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder
Inherited from
IterableOnceOps
@Doc(info = "aggregate all objects at this point into the given collection (side effect)")
def aggregate(into: Growable[A]): Traversal[A]

aggregate all objects at this point into the given collection (side effect)

aggregate all objects at this point into the given collection (side effect)

Example
val xs = mutable.ArrayBuffer.empty[A]
myTraversal.aggregate(xs).foo.bar
// xs will be filled once `myTraversal` is executed
Inherited from
Traversal
@Doc(info = "only preserves elements for which _all of_ the given traversals have at least one result")
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.

Example
 .and(_.label("someLabel"),
      _.has("someProperty"))
Inherited from
Traversal
@Doc(info = "casts all elements to given type")
def cast[B]: Traversal[B]

casts all elements to given type note: this can lead to casting errors

casts all elements to given type note: this can lead to casting errors

See also
collectAll
Inherited from
Traversal
@Doc(info = "allows to implement conditional semantics: if, if/else, if/elseif, if/elseif/else, ...")
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. Allows to implement conditional semantics: if, if/else, if/elseif, if/elseif/else, ...

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, ...

Type Params
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

Value Params
on

Traversal to get to what you want to match on

options

PartialFunction from the matched element to the resulting traversal

See also

LogicalStepsTests

Example
.choose(_.property(Name)) {
 case "L1" => _.out
 case "R1" => _.repeat(_.out)(_.times(3))
 case _ => _.in
}
Inherited from
Traversal
@Doc(info = "evaluates the provided traversals in order and returns the first traversal that emits at least one element")
def coalesce[NewEnd](options: Traversal[A] => Traversal[NewEnd]*): Traversal[NewEnd]

Branch step: evaluates the provided traversals in order and returns the first traversal that emits at least one element.

Branch step: evaluates the provided traversals in order and returns the first traversal that emits at least one element.

See also

LogicalStepsTests

Example
.coalesce(
  _.out("label1"),
  _.in("label2"),
  _.in("label3")
)
Inherited from
Traversal
@Doc(info = "collects and all elements of the provided type")
def collectAll[B : ClassTag]: Traversal[B]

collects and all elements of the given type

collects and all elements of the given type

Inherited from
Traversal
def collectFirst[B](pf: PartialFunction[A, B]): Option[B]
Inherited from
IterableOnceOps
def concat[B >: A](suffix: IterableOnce[B]): Traversal[B]
Inherited from
IterableOps
def copyToArray[B >: A](xs: Array[B], start: Int, len: Int): Int
Inherited from
IterableOnceOps
@deprecatedOverriding(message = "This should always forward to the 3-arg version of this method", since = "2.13.4")
def copyToArray[B >: A](xs: Array[B], start: Int): Int
Inherited from
IterableOnceOps
@deprecatedOverriding(message = "This should always forward to the 3-arg version of this method", since = "2.13.4")
def copyToArray[B >: A](xs: Array[B]): Int
Inherited from
IterableOnceOps
def corresponds[B](that: IterableOnce[B])(p: (A, B) => Boolean): Boolean
Inherited from
IterableOnceOps
def count: Traversal[Int]
Inherited from
Traversal
def count(p: A => Boolean): Int
Inherited from
IterableOnceOps
def drop(n: Int): Traversal[A]
Inherited from
IterableOps
def dropRight(n: Int): Traversal[A]
Inherited from
IterableOps
def dropWhile(p: A => Boolean): Traversal[A]
Inherited from
IterableOps
override
Definition Classes
IterableFactoryDefaults -> IterableOps
Inherited from
IterableFactoryDefaults
@Doc(info = "enable path tracking - prerequisite for path/simplePath steps")
Inherited from
Traversal
def exists(p: A => Boolean): Boolean
Inherited from
IterableOnceOps
def find(p: A => Boolean): Option[A]
Inherited from
IterableOnceOps
def flatten[B](implicit asIterable: A => IterableOnce[B]): Traversal[B]
Inherited from
IterableOps
def fold[A1 >: A](z: A1)(op: (A1, A1) => A1): A1
Inherited from
IterableOnceOps
def foldLeft[B](z: B)(op: (B, A) => B): B
Inherited from
IterableOnceOps
def foldRight[B](z: B)(op: (A, B) => B): B
Inherited from
IterableOnceOps
def forall(p: A => Boolean): Boolean
Inherited from
IterableOnceOps
def foreach[U](f: A => U): Unit
Inherited from
IterableOnceOps
protected
def fromSpecific(coll: IterableOnce[A]): Traversal[A]
Inherited from
IterableFactoryDefaults
def groupBy[K](f: A => K): Map[K, Traversal[A]]
Inherited from
IterableOps
@Doc(info = "group elements by a given transformation function and count how often the results appear")
def groupCount[B](by: A => B): Map[B, Int]

group elements by a given transformation function and count how often the results appear

group elements by a given transformation function and count how often the results appear

Inherited from
Traversal
@Doc(info = "group elements and count how often they appear")
def groupCount: Map[A, Int]

group elements and count how often they appear

group elements and count how often they appear

Inherited from
Traversal
def groupMap[K, B](key: A => K)(f: A => B): Map[K, Traversal[B]]
Inherited from
IterableOps
def groupMapReduce[K, B](key: A => K)(f: A => B)(reduce: (B, B) => B): Map[K, B]
Inherited from
IterableOps
def grouped(size: Int): Iterator[Traversal[A]]
Inherited from
IterableOps
def hasNext: Boolean
Inherited from
Traversal
def head: A
Inherited from
IterableOps
def headOption: Option[A]
Inherited from
IterableOps
@Doc(info = "print help/documentation based on the current elementType `A`.")
def help(implicit elementType: ClassTag[A]): String

Print help/documentation based on the current elementType A. Relies on all step extensions being annotated with @TraversalExt / @Doc Note that this works independently of tab completion and implicit conversions in scope - it will simply list all documented steps in the classpath

Print help/documentation based on the current elementType A. Relies on all step extensions being annotated with @TraversalExt / @Doc Note that this works independently of tab completion and implicit conversions in scope - it will simply list all documented steps in the classpath

Inherited from
Traversal
def helpVerbose(implicit elementType: ClassTag[A]): String
Inherited from
Traversal
def init: Traversal[A]
Inherited from
IterableOps
def inits: Iterator[Traversal[A]]
Inherited from
IterableOps
def isEmpty: Boolean
Inherited from
IterableOnceOps
override
def isTraversableAgain: Boolean
Definition Classes
IterableOps -> IterableOnceOps
Inherited from
IterableOps
override
def iterableFactory: IterableFactory[Traversal]
Definition Classes
Traversal -> IterableOps
Inherited from
Traversal
@Doc(info = "Execute the traversal without returning anything")
def iterate(): Unit

Execute the traversal without returning anything

Execute the traversal without returning anything

Inherited from
Traversal
def knownSize: Int
Inherited from
IterableOnce
@Doc(info = "Execute the traversal and convert the result to a list - shorthand for `toList`")
def l: List[A]

Execute the traversal and convert the result to a list - shorthand for toList

Execute the traversal and convert the result to a list - shorthand for toList

Inherited from
Traversal
def last: A
Inherited from
IterableOps
def lastOption: Option[A]
Inherited from
IterableOps
def max[B >: A](implicit ord: Ordering[B]): A
Inherited from
IterableOnceOps
def maxBy[B](f: A => B)(implicit cmp: Ordering[B]): A
Inherited from
IterableOnceOps
def maxByOption[B](f: A => B)(implicit cmp: Ordering[B]): Option[A]
Inherited from
IterableOnceOps
def maxOption[B >: A](implicit ord: Ordering[B]): Option[A]
Inherited from
IterableOnceOps
def min[B >: A](implicit ord: Ordering[B]): A
Inherited from
IterableOnceOps
def minBy[B](f: A => B)(implicit cmp: Ordering[B]): A
Inherited from
IterableOnceOps
def minByOption[B](f: A => B)(implicit cmp: Ordering[B]): Option[A]
Inherited from
IterableOnceOps
def minOption[B >: A](implicit ord: Ordering[B]): Option[A]
Inherited from
IterableOnceOps
@inline
final
def mkString: String
Inherited from
IterableOnceOps
@inline
final
def mkString(sep: String): String
Inherited from
IterableOnceOps
final
def mkString(start: String, sep: String, end: String): String
Inherited from
IterableOnceOps
protected
def newSpecificBuilder: Builder[A, Traversal[A]]
Inherited from
IterableFactoryDefaults
def next(): A
Inherited from
Traversal
def nextOption(): Option[A]
Inherited from
Traversal
@deprecatedOverriding(message = "nonEmpty is defined as !isEmpty; override isEmpty instead", since = "2.13.0")
def nonEmpty: Boolean
Inherited from
IterableOnceOps
@Doc(info = "only preserves elements if the provided traversal does _not_ have any results - alias for whereNot")
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

Inherited from
Traversal
@Doc(info = "only preserves elements for which _at least one of_ the given traversals has at least one result")
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.

Example
 .or(_.label("someLabel"),
     _.has("someProperty"))
Inherited from
Traversal
def partition(p: A => Boolean): (Traversal[A], Traversal[A])
Inherited from
IterableOps
def partitionMap[A1, A2](f: A => Either[A1, A2]): (Traversal[A1], Traversal[A2])
Inherited from
IterableOps
def product[B >: A](implicit num: Numeric[B]): B
Inherited from
IterableOnceOps
def reduce[B >: A](op: (B, B) => B): B
Inherited from
IterableOnceOps
def reduceLeft[B >: A](op: (B, A) => B): B
Inherited from
IterableOnceOps
def reduceLeftOption[B >: A](op: (B, A) => B): Option[B]
Inherited from
IterableOnceOps
def reduceOption[B >: A](op: (B, B) => B): Option[B]
Inherited from
IterableOnceOps
def reduceRight[B >: A](op: (A, B) => B): B
Inherited from
IterableOnceOps
def reduceRightOption[B >: A](op: (A, B) => B): Option[B]
Inherited from
IterableOnceOps
protected
def reversed: Iterable[A]
Inherited from
IterableOnceOps
def scan[B >: A](z: B)(op: (B, B) => B): Traversal[B]
Inherited from
IterableOps
def scanLeft[B](z: B)(op: (B, A) => B): Traversal[B]
Inherited from
IterableOps
def scanRight[B](z: B)(op: (A, B) => B): Traversal[B]
Inherited from
IterableOps
@Doc(info = "perform side effect without changing the contents of the traversal")
def sideEffect(fun: A => Unit): Traversal[A]

perform side effect without changing the contents of the traversal

perform side effect without changing the contents of the traversal

Inherited from
Traversal
@Doc(info = "perform side effect without changing the contents of the traversal")
def sideEffectPF(pf: PartialFunction[A, Unit]): 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

Inherited from
Traversal
def size: Int
Inherited from
IterableOnceOps
def sizeCompare(that: Iterable[_]): Int
Inherited from
IterableOps
def sizeCompare(otherSize: Int): Int
Inherited from
IterableOps
@inline
final
def sizeIs: SizeCompareOps
Inherited from
IterableOps
def slice(from: Int, until: Int): Traversal[A]
Inherited from
IterableOps
def sliding(size: Int, step: Int): Iterator[Traversal[A]]
Inherited from
IterableOps
def sliding(size: Int): Iterator[Traversal[A]]
Inherited from
IterableOps
@Doc(info = "sort elements by the value of the given transformation function")
def sortBy[B](f: A => B)(implicit ord: Ordering[B]): Seq[A]

sort elements by the value of the given transformation function

sort elements by the value of the given transformation function

Inherited from
Traversal
@Doc(info = "sort elements by their natural order")
def sorted(implicit ord: Ordering[A]): Seq[A]

sort elements by their natural order

sort elements by their natural order

Inherited from
Traversal
def span(p: A => Boolean): (Traversal[A], Traversal[A])
Inherited from
IterableOps
override
def splitAt(n: Int): (Traversal[A], Traversal[A])
Definition Classes
IterableOps -> IterableOnceOps
Inherited from
IterableOps
def stepper[S <: Stepper[_]](implicit shape: StepperShape[A, S]): S
Inherited from
IterableOnce
def sum[B >: A](implicit num: Numeric[B]): B
Inherited from
IterableOnceOps
def tail: Traversal[A]
Inherited from
IterableOps
def tails: Iterator[Traversal[A]]
Inherited from
IterableOps
def take(n: Int): Traversal[A]
Inherited from
IterableOps
def takeRight(n: Int): Traversal[A]
Inherited from
IterableOps
def takeWhile(p: A => Boolean): Traversal[A]
Inherited from
IterableOps
override
def tapEach[U](f: A => U): Traversal[A]
Definition Classes
IterableOps -> IterableOnceOps
Inherited from
IterableOps
def to[C1](factory: Factory[A, C1]): C1
Inherited from
IterableOnceOps
def toArray[B >: A : ClassTag]: Array[B]
Inherited from
IterableOnceOps
@inline
final
def toBuffer[B >: A]: Buffer[B]
Inherited from
IterableOnceOps
def toIndexedSeq: IndexedSeq[A]
Inherited from
IterableOnceOps
override
def toIterable: Iterable[A]
Definition Classes
Traversal -> IterableOps
Inherited from
Traversal
def toList: List[A]
Inherited from
IterableOnceOps
def toMap[K, V](implicit ev: A <:< (K, V)): Map[K, V]
Inherited from
IterableOnceOps
def toSeq: Seq[A]
Inherited from
IterableOnceOps
def toSet: Set[A]

Execute the traversal and return a mutable.Set (better performance than immutableSet)

Execute the traversal and return a mutable.Set (better performance than immutableSet)

Inherited from
Traversal
def toSet[B >: A]: Set[B]
Inherited from
IterableOnceOps
def toSetImmutable: Set[A]

Execute the traversal and convert the result to an immutable Set

Execute the traversal and convert the result to an immutable Set

Inherited from
Traversal
def toSetMutable: Set[A]

Execute the traversal and return a mutable.Set (better performance than immutableSet)

Execute the traversal and return a mutable.Set (better performance than immutableSet)

Inherited from
Traversal
override
def toString: String
Definition Classes
Traversal -> Any
Inherited from
Traversal
def toVector: Vector[A]
Inherited from
IterableOnceOps
def transpose[B](implicit asIterable: A => Iterable[B]): Traversal[Traversal[B]]
Inherited from
IterableOps
def unzip[A1, A2](implicit asPair: A => (A1, A2)): (Traversal[A1], Traversal[A2])
Inherited from
IterableOps
def unzip3[A1, A2, A3](implicit asTriple: A => (A1, A2, A3)): (Traversal[A1], Traversal[A2], Traversal[A3])
Inherited from
IterableOps
def view: View[A]
Inherited from
IterableOps
@Doc(info = "only preserves elements if the provided traversal has at least one result")
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

Inherited from
Traversal
@Doc(info = "only preserves elements if the provided traversal does _not_ have any results")
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

Inherited from
Traversal
def withFilter(p: A => Boolean): WithFilter[A, Traversal]
Inherited from
IterableOps
@Doc(info = "filters out all elements that are _not_ in the provided set")
def within(values: Set[A]): Traversal[A]

filters out all elements that are not in the provided set

filters out all elements that are not in the provided set

Inherited from
Traversal
@Doc(info = "filters out all elements that _are_ in the provided set")
def without(values: Set[A]): Traversal[A]

filters out all elements that are in the provided set

filters out all elements that are in the provided set

Inherited from
Traversal
def zip[B](that: IterableOnce[B]): Traversal[(A, B)]
Inherited from
IterableOps
def zipAll[A1 >: A, B](that: Iterable[B], thisElem: A1, thatElem: B): Traversal[(A1, B)]
Inherited from
IterableOps
def zipWithIndex: Traversal[(A, Int)]
Inherited from
IterableOps

Deprecated and Inherited methods

@deprecated(message = "Use ++ instead of ++: for collections of type Iterable", since = "2.13.0")
def ++:[B >: A](that: IterableOnce[B]): Traversal[B]
Deprecated
[Since version 2.13.0] Use ++ instead of ++: for collections of type Iterable
Inherited from
IterableOps
@inline @deprecated(message = "Use foldLeft instead of /:", since = "2.13.0")
final
def /:[B](z: B)(op: (B, A) => B): B
Deprecated
[Since version 2.13.0] Use foldLeft instead of /:
Inherited from
IterableOnceOps
@inline @deprecated(message = "Use foldRight instead of :\\", since = "2.13.0")
final
def :\[B](z: B)(op: (A, B) => B): B
Deprecated
[Since version 2.13.0] Use foldRight instead of :\\
Inherited from
IterableOnceOps
@deprecated(message = "`aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.", since = "2.13.0")
def aggregate[B](z: => B)(seqop: (B, A) => B, combop: (B, B) => B): B
Deprecated
[Since version 2.13.0] `aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.
Inherited from
IterableOnceOps
@inline @deprecatedOverriding(message = "Use iterableFactory instead", since = "2.13.0") @deprecated(message = "Use iterableFactory instead", since = "2.13.0")
def companion: IterableFactory[Traversal]
Deprecated
[Since version 2.13.0] Use iterableFactory instead
Inherited from
IterableOps
@inline @deprecated(message = "Use `dest ++= coll` instead", since = "2.13.0")
final
def copyToBuffer[B >: A](dest: Buffer[B]): Unit
Deprecated
[Since version 2.13.0] Use `dest ++= coll` instead
Inherited from
IterableOnceOps
@deprecated(message = "Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)", since = "2.13.0")
def hasDefiniteSize: Boolean
Deprecated
[Since version 2.13.0] Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
Inherited from
IterableOnceOps
@deprecated(message = "Use coll instead of repr in a collection implementation, use the collection value itself from the outside", since = "2.13.0")
final
def repr: Traversal[A]
Deprecated
[Since version 2.13.0] Use coll instead of repr in a collection implementation, use the collection value itself from the outside
Inherited from
IterableOps
@inline @deprecated(message = "Use .iterator instead of .toIterator", since = "2.13.0")
final
def toIterator: Iterator[A]
Deprecated
[Since version 2.13.0] Use .iterator instead of .toIterator
Inherited from
IterableOnceOps
@inline @deprecated(message = "Use .to(LazyList) instead of .toStream", since = "2.13.0")
final
def toStream: Stream[A]
Deprecated
[Since version 2.13.0] Use .to(LazyList) instead of .toStream
Inherited from
IterableOnceOps
@deprecated(message = "Use toIterable instead", since = "2.13.0")
final
def toTraversable: Iterable[A]
Deprecated
[Since version 2.13.0] Use toIterable instead
Inherited from
IterableOps
@deprecated(message = "Use .view.slice(from, until) instead of .view(from, until)", since = "2.13.0")
def view(from: Int, until: Int): View[A]
Deprecated
[Since version 2.13.0] Use .view.slice(from, until) instead of .view(from, until)
Inherited from
IterableOps

Concrete fields

val elementsWithPath: IterableOnce[(A, Vector[Any])]

Inherited fields

override
val iterator: Iterator[A]
Inherited from
Traversal