TreeLoc

org.specs2.fp.TreeLoc
See theTreeLoc companion object
final case class TreeLoc[A](tree: Tree[A], lefts: TreeForest[A], rights: TreeForest[A], parents: Parents[A])

Inspired from the scalaz (https://github.com/scalaz/scalaz) project

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def delete: Option[TreeLoc[A]]

Delete the current node and all its children.

Delete the current node and all its children.

Attributes

def find(p: TreeLoc[A] => Boolean): Option[TreeLoc[A]]

Select the first descendant node of the current node that satisfies the given predicate.

Select the first descendant node of the current node that satisfies the given predicate.

Attributes

def findChild(p: Tree[A] => Boolean): Option[TreeLoc[A]]

Select the first immediate child of the current node that satisfies the given predicate.

Select the first immediate child of the current node that satisfies the given predicate.

Attributes

def firstChild: Option[TreeLoc[A]]

Select the leftmost child of the current node.

Select the leftmost child of the current node.

Attributes

def getChild(n: Int): Option[TreeLoc[A]]

Select the nth child of the current node.

Select the nth child of the current node.

Attributes

def getLabel: A

Get the label of the current node.

Get the label of the current node.

Attributes

def hasChildren: Boolean

True if the current node has children.

True if the current node has children.

Attributes

def insertDownAt(n: Int, t: Tree[A]): Option[TreeLoc[A]]

Insert the given node as the nth child of the current node and give it focus.

Insert the given node as the nth child of the current node and give it focus.

Attributes

def insertDownFirst(t: Tree[A]): TreeLoc[A]

Insert the given node as the first child of the current node and give it focus.

Insert the given node as the first child of the current node and give it focus.

Attributes

def insertDownLast(t: Tree[A]): TreeLoc[A]

Insert the given node as the last child of the current node and give it focus.

Insert the given node as the last child of the current node and give it focus.

Attributes

def insertLeft(t: Tree[A]): TreeLoc[A]

Insert the given node to the left of the current node and give it focus.

Insert the given node to the left of the current node and give it focus.

Attributes

def insertRight(t: Tree[A]): TreeLoc[A]

Insert the given node to the right of the current node and give it focus.

Insert the given node to the right of the current node and give it focus.

Attributes

def isChild: Boolean

True if the current node is not the root node.

True if the current node is not the root node.

Attributes

def isFirst: Boolean

True if the current node has no left siblings.

True if the current node has no left siblings.

Attributes

def isLast: Boolean

True if the current node has no right siblings.

True if the current node has no right siblings.

Attributes

def isLeaf: Boolean

True if the current node has no children.

True if the current node has no children.

Attributes

def isRoot: Boolean

True if the current node is the root node.

True if the current node is the root node.

Attributes

def lastChild: Option[TreeLoc[A]]

Select the rightmost child of the current node.

Select the rightmost child of the current node.

Attributes

def left: Option[TreeLoc[A]]

Select the left sibling of the current node.

Select the left sibling of the current node.

Attributes

def map[B](f: A => B): TreeLoc[B]

Maps the given function over the elements.

Maps the given function over the elements.

Attributes

def modifyLabel(f: A => A): TreeLoc[A]

Modify the label at the current node with the given function.

Modify the label at the current node with the given function.

Attributes

def modifyTree(f: Tree[A] => Tree[A]): TreeLoc[A]

Modify the current node with the given function.

Modify the current node with the given function.

Attributes

def parent: Option[TreeLoc[A]]

Select the parent of the current node.

Select the parent of the current node.

Attributes

def path: LazyList[A]

The path from the focus to the root.

The path from the focus to the root.

Attributes

def right: Option[TreeLoc[A]]

Select the right sibling of the current node.

Select the right sibling of the current node.

Attributes

def root: TreeLoc[A]

Select the root node of the tree.

Select the root node of the tree.

Attributes

def setLabel(a: A): TreeLoc[A]

Set the label of the current node.

Set the label of the current node.

Attributes

def setTree(t: Tree[A]): TreeLoc[A]

Replace the current node with the given one.

Replace the current node with the given one.

Attributes

def size: Int

Get the size of the whole tree

Get the size of the whole tree

Attributes

Get the entire forest represented by this zipper.

Get the entire forest represented by this zipper.

Attributes

def toTree: Tree[A]

Get the entire tree represented by this zipper.

Get the entire tree represented by this zipper.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product