Trees

org.specs2.data.Trees
See theTrees companion trait
object Trees extends Trees

Attributes

Companion
trait
Graph
Supertypes
trait Trees
class Object
trait Matchable
class Any
Self type
Trees.type

Members list

Value members

Inherited methods

def allPaths[A](tree: Tree[A]): List[List[A]]

Attributes

Returns

all the paths from root to leaves

Inherited from:
Trees
def bottomUp[A, B](t: Tree[A], f: (A, LazyList[B]) => B): Tree[B]

map a Tree from leaves to root by replacing each node with the result of a function taking that node and the mapping of all its children.

map a Tree from leaves to root by replacing each node with the result of a function taking that node and the mapping of all its children.

This is used in JUnit to map a Tree[Description] where no Description objects are related to a Tree[Description] where each node returns the children nodes on the "getChildren" method

Attributes

Inherited from:
Trees
def clean[A](t: Tree[Option[A]])(using initial: A): Tree[A]

remove None nodes from a tree

remove None nodes from a tree

Attributes

Inherited from:
Trees
def flattenLeft[A](tree: Tree[A]): LazyList[A]

flatten the tree using a foldLeft to avoid SOF

flatten the tree using a foldLeft to avoid SOF

Attributes

Inherited from:
Trees
def flattenSubForests[A](tree: Tree[A]): Tree[A]

Attributes

Inherited from:
Trees
def parentLocs[T](t: TreeLoc[T], ps: Seq[TreeLoc[T]]): Seq[TreeLoc[T]]

Attributes

Returns

the list of all parent locs from a given TreeLoc

Inherited from:
Trees
def prune[A](t: Tree[A], f: (Tree[A]) => Option[A])(using initial: A): Tree[A]

remove nodes from a tree if they are None according to a function f

remove nodes from a tree if they are None according to a function f

Attributes

Inherited from:
Trees
def prune[A, B](t: Tree[A], f: A => Option[B]): Option[Tree[B]]

remove nodes from a tree if they are None according to a function f

remove nodes from a tree if they are None according to a function f

Attributes

Inherited from:
Trees
def size[A](t: TreeLoc[A]): Int

Attributes

Returns

the number of nodes in a TreeLoc

Inherited from:
Trees

Givens

Inherited givens

given treeIsSized[T]: treeIsSized[T]

Attributes

Inherited from:
Trees
given treeLocIsSized[T]: treeLocIsSized[T]

Attributes

Inherited from:
Trees

Extensions

Inherited extensions

extension [A, B](t: Tree[A])
def bottomUp(f: (A, LazyList[B]) => B): Tree[B]

extension methods for the Tree trait

extension methods for the Tree trait

Attributes

Inherited from:
Trees
def prune(f: A => Option[B]): Option[Tree[B]]

extension methods for the Tree trait

extension methods for the Tree trait

Attributes

Inherited from:
Trees
extension [A](t: Tree[A])
def allPaths(using nothing: Int): List[List[A]]

Attributes

Inherited from:
Trees
def flattenLeft(using nothing: Int): LazyList[A]

Attributes

Inherited from:
Trees
def flattenSubForests(using nothing: Int): Tree[A]

Attributes

Inherited from:
Trees
def prune(f: (Tree[A]) => Option[A])(using initial: A): Tree[A]

Attributes

Inherited from:
Trees
def size: Int

Attributes

Inherited from:
Trees
extension [A](t: Tree[Option[A]])
def clean(using initial: A, nothing: Int): Tree[A]

This implicit can be used to remove None nodes in a Tree

This implicit can be used to remove None nodes in a Tree

Attributes

Inherited from:
Trees
extension [T](t: TreeLoc[T])
def addChild(c: T): TreeLoc[T]

Implicit definition to add more functionalities to the TreeLoc class

Implicit definition to add more functionalities to the TreeLoc class

Attributes

Inherited from:
Trees
def addFirstChild(c: T): TreeLoc[T]

Implicit definition to add more functionalities to the TreeLoc class

Implicit definition to add more functionalities to the TreeLoc class

Attributes

Inherited from:
Trees
def getParent: TreeLoc[T]

Implicit definition to add more functionalities to the TreeLoc class

Implicit definition to add more functionalities to the TreeLoc class

Attributes

Inherited from:
Trees
def insertDownLast(c: T): TreeLoc[T]

Implicit definition to add more functionalities to the TreeLoc class

Implicit definition to add more functionalities to the TreeLoc class

Attributes

Inherited from:
Trees
def parentLocs: Seq[TreeLoc[T]]

Implicit definition to add more functionalities to the TreeLoc class

Implicit definition to add more functionalities to the TreeLoc class

Attributes

Inherited from:
Trees
def size(using nothing: Int): Int

Implicit definition to add more functionalities to the TreeLoc class

Implicit definition to add more functionalities to the TreeLoc class

Attributes

Inherited from:
Trees
def updateLabel(f: T => T): TreeLoc[T]

Implicit definition to add more functionalities to the TreeLoc class

Implicit definition to add more functionalities to the TreeLoc class

Attributes

Inherited from:
Trees