TraversalSugarExt

overflowdb.traversal.TraversalSugarExt
final class TraversalSugarExt[A](val iter: Iterator[A]) extends AnyVal

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Type members

Types

type Traversal[A] = Iterator[A]

Value members

Concrete methods

def cast[B]: Iterator[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

Attributes

See also
collectAll

as a safe alternative

def collectAll[B](implicit ev: ClassTag[B]): Iterator[B]

collects all elements of the given class (beware of type-erasure)

collects all elements of the given class (beware of type-erasure)

Attributes

def countTrav: Iterator[Int]
def dedup: Iterator[A]

Deduplicate elements of this traversal - a.k.a. distinct, unique, ...

Deduplicate elements of this traversal - a.k.a. distinct, unique, ...

Attributes

def dedupBy(fun: A => Any): Iterator[A]

deduplicate elements of this traversal by a given function

deduplicate elements of this traversal by a given function

Attributes

def groupBy[K](f: A => K): Map[K, List[A]]
def groupCount[B >: A]: Map[B, Int]

group elements and count how often they appear

group elements and count how often they appear

Attributes

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

Attributes

def groupMap[K, B](key: A => K)(f: A => B): Map[K, List[B]]
def groupMapReduce[K, B](key: A => K)(f: A => B)(reduce: (B, B) => B): Map[K, B]
def head: A
def headOption: Option[A]
def help[B >: A](implicit elementType: ClassTag[B], searchPackages: DocSearchPackages, availableWidthProvider: AvailableWidthProvider): String

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

Attributes

def helpVerbose[B >: A](implicit elementType: ClassTag[B], searchPackages: DocSearchPackages, availableWidthProvider: AvailableWidthProvider): String
def iterate(): Unit

Execute the traversal without returning anything

Execute the traversal without returning anything

Attributes

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

Attributes

def last: A
def lastOption: Option[A]
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

Attributes

def sorted[B >: A](implicit ord: Ordering[B]): Seq[B]

sort elements by their natural order

sort elements by their natural order

Attributes

def toSetImmutable[B >: A]: Set[B]

Execute the traversal and convert the result to an immutable Set.

Execute the traversal and convert the result to an immutable Set.

Attributes

def toSetMutable[B >: A]: LinkedHashSet[B]

Execute the traversal and return a mutable.Set (better performance than immutableSet and has stable iterator order)

Execute the traversal and return a mutable.Set (better performance than immutableSet and has stable iterator order)

Attributes

Concrete fields

val iter: Iterator[A]