final class RoseTree[+A] extends Product with Serializable
Implements a finitely branching tree, also known as a rose tree. All methods are stack-safe.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- RoseTree
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
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
- def canEqual(that: Any): Boolean
- Definition Classes
- RoseTree → Equals
- Annotations
- @SuppressWarnings()
- val children: Seq[RoseTree[A]]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(other: Any): Boolean
- Definition Classes
- RoseTree → Equals → AnyRef → Any
- Annotations
- @SuppressWarnings()
- def foldl[State, Result](init: (RoseTree[A]) => State)(finish: (State) => Result)(update: (State, Result) => State): Result
Tail-recursive implementation equivalent to
Tail-recursive implementation equivalent to
def foldl[State, Result](tree: RoseTree[A])(init: RoseTree[A] => State)(finish: State => Result)(update: (State, Result) => State): Result = finish(children.foldLeft(init(this))((acc, child) => update(acc, child.foldl(init)(finish)(update))))
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
Tail-recursive implementation for RoseTree equivalent to scala.util.hashing.MurmurHash3$.productHash(x:Product):Int*
Tail-recursive implementation for RoseTree equivalent to scala.util.hashing.MurmurHash3$.productHash(x:Product):Int*
- Definition Classes
- RoseTree → AnyRef → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[B](f: (A) => B): RoseTree[B]
Tail-recursive implementation equivalent to
Tail-recursive implementation equivalent to
def map[A](f: A => B): RoseTree[B] = RoseTree(f(root), children.map(_.map(f))*)
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def preorder: Iterator[A]
Iterator over all elements in this tree in preorder
- def productArity: Int
- Definition Classes
- RoseTree → Product
- def productElement(n: Int): Any
- Definition Classes
- RoseTree → Product
- def productElementName(n: Int): String
- Definition Classes
- Product
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def productIterator: Iterator[Any]
- Definition Classes
- Product
- def productPrefix: String
- Definition Classes
- RoseTree → Product
- val root: A
- val size: Int
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- RoseTree → AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def zipWith[B, C](that: RoseTree[B])(f: (A, B) => C): RoseTree[C]
Tail-recursive implementation equivalent to
Tail-recursive implementation equivalent to
def zipWith[B, C](that: RoseTree[B])(f: (A, B) => C): RoseTree[C] = RoseTree( f(this.root, that.root), (this.children.zip(that.children).map { case (l, r) => l.zipWith(r)(f) }) *, )