|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.filter.QuantCalc
public abstract class QuantCalc
Object for accumulating values in order to calculate quantiles.
Field Summary | |
---|---|
static double |
MAD_SCALE
Value by which Median Absolute Deviation is scaled to estimate SD. |
Constructor Summary | |
---|---|
protected |
QuantCalc(Class clazz)
Constructor. |
Method Summary | |
---|---|
abstract void |
acceptDatum(Object obj)
Submits a datum for accumulation. |
static double |
calculateMedianAbsoluteDeviation(QuantCalc qcalc)
Calculates the median absolute deviation of the statistics accumulated by a QuantCalc. |
static QuantCalc |
createInstance(Class clazz,
long nrow)
Factory method to create a quantile accumulator for a given row count and value class. |
abstract Number |
getQuantile(double quant)
Returns a quantile corresponding to a given point. |
abstract long |
getValueCount()
Returns the number of non-blank values accumulated by this calculator. |
abstract Iterator<Number> |
getValueIterator()
Returns an iterator over all the non-blank values accumulated by this calculator. |
abstract void |
ready()
Call this method after all acceptDatum(java.lang.Object) calls have been made
and before any call to getQuantile(double) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double MAD_SCALE
Constructor Detail |
---|
protected QuantCalc(Class clazz)
clazz
- class of data objects which will be submitted;
must be assignable from Number classMethod Detail |
---|
public abstract void acceptDatum(Object obj)
obj
- data object - must be instance of numeric class
suitable for this accumulatorpublic abstract void ready()
acceptDatum(java.lang.Object)
calls have been made
and before any call to getQuantile(double)
.
public abstract Number getQuantile(double quant)
quant
- quant value between 0 and 1,
for instance 0.5 indicates medianpublic abstract long getValueCount()
public abstract Iterator<Number> getValueIterator()
ready()
has been called, they will be in ascending order.
The number of values it iterates over will be equal to
the result of getValueCount()
.
public static QuantCalc createInstance(Class clazz, long nrow) throws IOException
nrow
- row count; may be -1 to indicate that the row count
is unknownclazz
- class of data objects which will be submitted;
must be assignable from Number.class.
IOException
public static double calculateMedianAbsoluteDeviation(QuantCalc qcalc) throws IOException
qcalc
- calculator in ready state
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |