case class Tree[+T](value: T, children: Seq[Tree[T]]) extends Product with Serializable
An immutable tree with each node containing a value, and a Seq
of
children. Provides all normal Seq
functionality as well as some tree
specific methods.
- Alphabetic
- By Inheritance
- Tree
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val children: Seq[Tree[T]]
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
iterator: Iterator[T]
An iterator over the values stored on the nodes of this tree, in a depth first manner starting from the root.
-
def
leaves: Iterator[T]
Returns an iterator for the values at the leaves of this tree
-
def
length: Int
The number of nodes in this tree.
-
def
map[V](f: (T) ⇒ V): Tree[V]
Transforms this tree into a new tree by applying the function
f
to the value at every node.Transforms this tree into a new tree by applying the function
f
to the value at every node. Does not change the shape of the tree. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
reduce[V >: T](f: (V, Seq[V]) ⇒ V): V
Combines the values in this tree into a single value by recursively collapsing each subtree using the function
f
, starting from the leaves and working its way back up to the root. -
def
scan[V](f: (T, Seq[Tree[V]]) ⇒ (V, Seq[Tree[V]])): Tree[V]
Transforms this tree into a new Tree by recursively walking the nodes and applying the function
f
to each subtree to transform it.Transforms this tree into a new Tree by recursively walking the nodes and applying the function
f
to each subtree to transform it. Starts from the leaves and works its way back up to the root. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def toSeq: Seq[T]
- val value: T
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )