@Equality public abstract class Combiner extends java.lang.Object
Note that the SUM
mode is usually sensible for unweighted values,
but if the values are weighted it may be more revealing to use
one of the others (like MEAN
).
Modifier and Type | Class and Description |
---|---|
static interface |
Combiner.Container
Defines an object that can be used to accumulate values and
retrieve a result.
|
Modifier and Type | Field and Description |
---|---|
static Combiner |
COUNT
Report the number of submitted values.
|
static Combiner |
HIT
Return 1 if any value submitted, 0 otherwise.
|
static Combiner |
MAX
Calculate the maximum of all submitted values.
|
static Combiner |
MEAN
Calculate the mean of all submitted values.
|
static Combiner |
MEDIAN
Calculate the median of all submitted values (slow).
|
static Combiner |
MIN
Calculate the minimum of all submitted values.
|
static Combiner |
SAMPLE_STDEV
Calculate the sample standard deviation of all submitted values.
|
static Combiner |
SUM
Calculate the sum of all submitted values.
|
Modifier | Constructor and Description |
---|---|
protected |
Combiner(java.lang.String name,
java.lang.String description,
boolean hasBigBin)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract BinList |
createArrayBinList(int size)
May be able to create a bin list suitable for non-sparse,
moderate-sized index ranges.
|
abstract uk.ac.starlink.table.ValueInfo |
createCombinedInfo(uk.ac.starlink.table.ValueInfo info)
Returns a metadata object that describes the result of applying
this combiner to data described by a given metadata object.
|
abstract Combiner.Container |
createContainer()
Creates an object which can be used to accumulate values.
|
abstract BinList |
createHashBinList(long size)
Creates a generaly purpose bin list, which may be especially
suitable for sparse index ranges.
|
java.lang.String |
getDescription()
Returns a short textual description of this combiner.
|
static Combiner[] |
getKnownCombiners()
Returns a list of the known general purpose instances of this class.
|
java.lang.String |
getName()
Returns this combiner's name.
|
boolean |
hasBigBin()
Indicates whether the bin objects used by this combiner are large.
|
java.lang.String |
toString() |
public static final Combiner COUNT
public static final Combiner SUM
public static final Combiner MEAN
public static final Combiner MEDIAN
public static final Combiner SAMPLE_STDEV
public static final Combiner MIN
public static final Combiner MAX
public static final Combiner HIT
protected Combiner(java.lang.String name, java.lang.String description, boolean hasBigBin)
name
- namedescription
- short textual descriptionhasBigBin
- indicates whether the bins used by this combiner
are large
(take more memory than a double
)public abstract Combiner.Container createContainer()
Note: Since many container instances may by generated (when using a HashBinList) it is desirable to keep the returned objects as small as possible. In particular, it's a good idea to make the returned objects instances of a static class, to avoid an unncecessary reference to the owner object, unless there's a really compelling reason to do otherwise.
public abstract BinList createArrayBinList(int size)
size
- index range of required bin listpublic abstract BinList createHashBinList(long size)
size
- index range of required bin listpublic java.lang.String getName()
public java.lang.String getDescription()
public boolean hasBigBin()
double
.
This flag may be used to decide whether to compact bin list results.public abstract uk.ac.starlink.table.ValueInfo createCombinedInfo(uk.ac.starlink.table.ValueInfo info)
info
- metadata for values to be combined, usually numericpublic java.lang.String toString()
toString
in class java.lang.Object
public static Combiner[] getKnownCombiners()
Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.