|
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.Digit<V,A>
public abstract class Digit<V,A>
A digit is a vector of 1-4 elements. Serves as a pointer to the prefix or suffix of a finger tree.
Method Summary | ||
---|---|---|
abstract
|
foldLeft(F<B,F<A,B>> f,
B z)
Folds this digit to the left using the given function and the given initial value. |
|
abstract
|
foldRight(F<A,F<B,B>> f,
B z)
Folds this digit to the right using the given function and the given initial value. |
|
|
map(F<A,B> f,
Measured<V,B> m)
Maps a function across the elements of this digit, measuring with the given measurement. |
|
abstract
|
match(F<One<V,A>,B> one,
F<Two<V,A>,B> two,
F<Three<V,A>,B> three,
F<Four<V,A>,B> four)
Structural pattern matching on digits. |
|
V |
measure()
Returns the sum of the measurements of this digit according to the monoid. |
|
A |
reduceLeft(F<A,F<A,A>> f)
Folds this digit to the right using the given function. |
|
A |
reduceRight(F<A,F<A,A>> f)
Folds this digit to the right using the given function. |
|
FingerTree<V,A> |
toTree()
Returns the tree representation of this digit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public abstract <B> B foldRight(F<A,F<B,B>> f, B z)
f
- A function with which to fold this digit.z
- An initial value to apply at the rightmost end of the fold.
public abstract <B> B foldLeft(F<B,F<A,B>> f, B z)
f
- A function with which to fold this digit.z
- An initial value to apply at the leftmost end of the fold.
public final A reduceRight(F<A,F<A,A>> f)
f
- A function with which to fold this digit.
public final A reduceLeft(F<A,F<A,A>> f)
f
- A function with which to fold this digit.
public <B> Digit<V,B> map(F<A,B> f, Measured<V,B> m)
f
- A function to map across the elements of this digit.m
- A measuring for the function's domain (destination type).
public abstract <B> B match(F<One<V,A>,B> one, F<Two<V,A>,B> two, F<Three<V,A>,B> three, F<Four<V,A>,B> four)
one
- A function to apply to this digit if it's One.two
- A function to apply to this digit if it's Two.three
- A function to apply to this digit if it's Three.four
- A function to apply to this digit if it's Four.
public V measure()
public FingerTree<V,A> toTree()
|
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 |