TreeLoc

final case
class TreeLoc[A](tree: Tree[A], lefts: TreeForest[A], rights: TreeForest[A], parents: Parents[A])

A rose-tree zipper. Represents a scalaz.Tree together with a position in that tree. Provides navigation, persistent update, insertion, and deletes.

Value Params
lefts

The left siblings of the current node.

parents

The parent contexts of the current node.

rights

The right siblings of the current node.

tree

The currently selected node.

Companion
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

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.

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.

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.

def firstChild: Option[TreeLoc[A]]

Select the leftmost child of the current node.

Select the leftmost child of the current node.

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

Select the nth child of the current node.

Select the nth child of the current node.

def getLabel: A

Get the label of the current node.

Get the label of the current node.

def hasChildren: Boolean

True if the current node has children.

True if the current node has children.

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.

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.

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.

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.

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.

def isChild: Boolean

True if the current node is not the root node.

True if the current node is not the root node.

def isFirst: Boolean

True if the current node has no left siblings.

True if the current node has no left siblings.

def isLast: Boolean

True if the current node has no right siblings.

True if the current node has no right siblings.

def isLeaf: Boolean

True if the current node has no children.

True if the current node has no children.

def isRoot: Boolean

True if the current node is the root node.

True if the current node is the root node.

def lastChild: Option[TreeLoc[A]]

Select the rightmost child of the current node.

Select the rightmost child of the current node.

def left: Option[TreeLoc[A]]

Select the left sibling of the current node.

Select the left sibling of the current node.

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

Maps the given function over the elements.

Maps the given function over the elements.

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.

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.

def parent: Option[TreeLoc[A]]

Select the parent of the current node.

Select the parent of the current node.

The path from the focus to the root.

The path from the focus to the root.

def right: Option[TreeLoc[A]]

Select the right sibling of the current node.

Select the right sibling of the current node.

@tailrec
def root: TreeLoc[A]

Select the root node of the tree.

Select the root node of the tree.

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

Set the label of the current node.

Set the label of the current node.

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

Replace the current node with the given one.

Replace the current node with the given one.

Get the entire forest represented by this zipper.

Get the entire forest represented by this zipper.

def toTree: Tree[A]

Get the entire tree represented by this zipper.

Get the entire tree represented by this zipper.

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product