sealed trait FingerTree[V, +A] extends AnyRef
- Alphabetic
- By Inheritance
- FingerTree
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
Tree = FingerTree[V, A]
- Attributes
- protected[this]
Abstract Value Members
- abstract def ++[A1 >: A](right: FingerTree[V, A1])(implicit m: Measure[A1, V]): FingerTree[V, A1]
-
abstract
def
+:[A1 >: A](b: A1)(implicit m: Measure[A1, V]): FingerTree[V, A1]
Prepends an element to the tree.
Prepends an element to the tree.
- b
the element to prepend
- m
the measure used to update the tree's measure
- returns
the new tree with the element prepended
-
abstract
def
:+[A1 >: A](b: A1)(implicit m: Measure[A1, V]): FingerTree[V, A1]
Appends an element to the tree.
Appends an element to the tree.
- b
the element to append
- m
the measure used to update the tree's structure
- returns
the new tree with the element appended
- abstract def dropWhile(pred: (V) ⇒ Boolean)(implicit m: Measure[A, V]): Tree
- abstract def dropWhile1(pred: (V) ⇒ Boolean, init: V)(implicit m: Measure[A, V]): (A, Tree)
-
abstract
def
find1(pred: (V) ⇒ Boolean)(implicit m: Measure[A, V]): (V, A)
Traverses the tree until a predicate on an element becomes
true, and then returns that element.Traverses the tree until a predicate on an element becomes
true, and then returns that element. Note that ifpredreturnsfalsefor every element, the last element in the tree is returned (rather than a runtime exception being thrown).If the tree is empty, this throws a runtime exception.
- pred
a test function applied to the elements of the tree from left to right, until a the test returns
true.- returns
the discerning element
-
abstract
def
head: A
Returns the first (left-most) element in the tree.
Returns the first (left-most) element in the tree. Throws a runtime exception if performed on an empty tree.
- returns
the head element
-
abstract
def
headOption: Option[A]
Returns the first (left-most) element in the tree as an option.
Returns the first (left-most) element in the tree as an option.
- returns
the head element (
Some), orNoneif the tree is empty
-
abstract
def
init(implicit m: Measure[A, V]): Tree
Drops the last element of the tree.
Drops the last element of the tree.
- returns
the tree where the last element has been removed
-
abstract
def
isEmpty: Boolean
Queries whether the tree is empty or not
Queries whether the tree is empty or not
- returns
trueif the tree is empty
-
abstract
def
iterator: Iterator[A]
Creates an
Iteratorover the elements of the treeCreates an
Iteratorover the elements of the tree- returns
a fresh
Iteratorfor the tree elements
-
abstract
def
last: A
Returns the last (right-most) element in the tree.
Returns the last (right-most) element in the tree. Throws a runtime exception if performed on an empty tree.
- returns
the last element
-
abstract
def
lastOption: Option[A]
Returns the last (right-most) element in the tree as an option.
Returns the last (right-most) element in the tree as an option.
- returns
the last element (
Some), orNoneif the tree is empty
-
abstract
def
measure: V
Queries the measure of the tree, which might be its size or sum
Queries the measure of the tree, which might be its size or sum
- returns
the measure of the tree
-
abstract
def
span(pred: (V) ⇒ Boolean)(implicit m: Measure[A, V]): (Tree, Tree)
Same as
span1, but prepends the discerning element to the right tree, returning the left and right tree.Same as
span1, but prepends the discerning element to the right tree, returning the left and right tree. Unlikespan1, this is an allowed operation on an empty tree.- pred
a test function applied to the elements of the tree from left to right, until a the test returns
false.- returns
the split tree, as a
Tuple2with the left and the right tree
-
abstract
def
span1(pred: (V) ⇒ Boolean)(implicit m: Measure[A, V]): (Tree, A, Tree)
Traverses the tree until a predicate on an element becomes
false, and then splits the tree, returning the elements before that element (the prefix for which the predicate holds), the element itself (the first for which the predicate does not hold), and the remaining elements.Traverses the tree until a predicate on an element becomes
false, and then splits the tree, returning the elements before that element (the prefix for which the predicate holds), the element itself (the first for which the predicate does not hold), and the remaining elements.This method is somewhat analogous to the
spanmethod in standard Scala collections, the difference being that the predicate tests the tree's measure and not individual elements.Note that the returned discerning element corresponds to the last element in the tree, if
predreturnstruefor every element (rather than a runtime exception being thrown).If the tree is empty, this throws a runtime exception.
- pred
a test function applied to the elements of the tree from left to right, until a the test returns
true.- returns
the split tree, as a
Tuple3with the left tree, the discerning element, and the right tree
-
abstract
def
tail(implicit m: Measure[A, V]): Tree
Returns a copy of the tree with the first (head) element removed.
Returns a copy of the tree with the first (head) element removed. Throws a runtime exception if performed on an empty tree.
- m
the measure used to update the tree's structure
- returns
the new tree with the first element removed
- abstract def takeWhile(pred: (V) ⇒ Boolean)(implicit m: Measure[A, V]): Tree
- abstract def takeWhile1(pred: (V) ⇒ Boolean, init: V)(implicit m: Measure[A, V]): (Tree, A)
- abstract def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, A, Col[A]]): Col[A]
-
abstract
def
toList: List[A]
Converts the tree to a
Listrepresentation.Converts the tree to a
Listrepresentation.- returns
a
Listconstructed from the elements in the tree
- abstract def viewLeft(implicit m: Measure[A, V]): ViewLeft[V, A]
- abstract def viewRight(implicit m: Measure[A, V]): ViewRight[V, A]
Concrete 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
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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( ... )