|
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.Measured<V,A>
public final class Measured<V,A>
Determines how the elements of a tree are measured and how measures are summed. Consists of a monoid and a measuring function. Different instances of this class will result in different behaviours for the tree.
Method Summary | ||
---|---|---|
Measured<V,Digit<V,A>> |
digitMeasured()
A measured instance for digits. |
|
F<A,V> |
measure()
Returns the measuring function. |
|
V |
measure(A a)
Measures a given element. |
|
static
|
measured(Monoid<V> m,
F<A,V> measure)
|
|
Monoid<V> |
monoid()
Returns the monoid used to sum measures. |
|
Measured<V,Node<V,A>> |
nodeMeasured()
A measured instance for nodes. |
|
V |
sum(V a,
V b)
Sums the given measurements with the monoid. |
|
V |
zero()
Returns the identity measurement for the monoid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <V,A> Measured<V,A> measured(Monoid<V> m, F<A,V> measure)
public Monoid<V> monoid()
public F<A,V> measure()
public V measure(A a)
a
- An element to measure.
public V sum(V a, V b)
a
- A measurement to add to another.b
- A measurement to add to another.
public V zero()
public Measured<V,Node<V,A>> nodeMeasured()
public Measured<V,Digit<V,A>> digitMeasured()
|
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 |