|
Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfj.data.fingertrees.FingerTree<V,A>
fj.data.fingertrees.Single<V,A>
public final class Single<V,A>
A tree with a single element.
Method Summary | ||
---|---|---|
FingerTree<V,A> |
append(FingerTree<V,A> t)
Appends one finger tree to another. |
|
FingerTree<V,A> |
cons(A b)
Adds the given element to this tree as the first element. |
|
|
foldLeft(F<B,F<A,B>> bff,
B z)
Folds the tree to the left with the given function and the given initial element. |
|
|
foldRight(F<A,F<B,B>> aff,
B z)
Folds the tree to the right with the given function and the given initial element. |
|
P2<Integer,A> |
lookup(F<V,Integer> o,
int i)
|
|
|
map(F<A,B> abf,
Measured<V,B> m)
Maps the given function across this tree, measuring with the given Measured instance. |
|
|
match(F<Empty<V,A>,B> empty,
F<Single<V,A>,B> single,
F<Deep<V,A>,B> deep)
Pattern matching on the structure of this tree. |
|
V |
measure()
Returns the annotation of this tree's single element. |
|
A |
reduceLeft(F<A,F<A,A>> aff)
Folds the tree to the left with the given function. |
|
A |
reduceRight(F<A,F<A,A>> aff)
Folds the tree to the right with the given function. |
|
FingerTree<V,A> |
snoc(A b)
Adds the given element to this tree as the last element. |
|
A |
value()
Returns the single element of this tree. |
Methods inherited from class fj.data.fingertrees.FingerTree |
---|
isEmpty, measured, measured, mkTree |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public <B> B foldRight(F<A,F<B,B>> aff, B z)
FingerTree
foldRight
in class FingerTree<V,A>
aff
- A function with which to fold the tree.z
- An initial element to apply to the fold.
FingerTree.foldRight(fj.F, Object)
public A reduceRight(F<A,F<A,A>> aff)
FingerTree
reduceRight
in class FingerTree<V,A>
aff
- A function with which to fold the tree.
FingerTree.reduceRight(fj.F)
public <B> B foldLeft(F<B,F<A,B>> bff, B z)
FingerTree
foldLeft
in class FingerTree<V,A>
bff
- A function with which to fold the tree.z
- An initial element to apply to the fold.
public A reduceLeft(F<A,F<A,A>> aff)
FingerTree
reduceLeft
in class FingerTree<V,A>
aff
- A function with which to fold the tree.
public <B> FingerTree<V,B> map(F<A,B> abf, Measured<V,B> m)
FingerTree
map
in class FingerTree<V,A>
abf
- A function to map across the values of this tree.m
- A measuring with which to annotate the tree.
public V measure()
measure
in class FingerTree<V,A>
public <B> B match(F<Empty<V,A>,B> empty, F<Single<V,A>,B> single, F<Deep<V,A>,B> deep)
match
in class FingerTree<V,A>
empty
- The function to apply to this empty tree.single
- A function to apply if this tree contains a single element.deep
- A function to apply if this tree contains more than one element.
public FingerTree<V,A> cons(A b)
FingerTree
cons
in class FingerTree<V,A>
b
- The element to add to the front of this tree.
public FingerTree<V,A> snoc(A b)
FingerTree
snoc
in class FingerTree<V,A>
b
- The element to add to the end of this tree.
public FingerTree<V,A> append(FingerTree<V,A> t)
FingerTree
append
in class FingerTree<V,A>
t
- A finger tree to append to this one.
public P2<Integer,A> lookup(F<V,Integer> o, int i)
lookup
in class FingerTree<V,A>
public A value()
|
Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |