public class Aggregation
extends java.lang.Object
implements java.lang.Cloneable
AggregationKey
.
Constructor and Description |
---|
Aggregation(AggregationFunction type)
Creates an aggregation.
|
Modifier and Type | Method and Description |
---|---|
void |
add(AggregationKey key,
long data)
Adds an item of data to the aggregation with the specified grouping key.
|
void |
add(long data)
Adds an item of data to the aggregation with an empty key.
|
void |
clear()
Resets all values in the aggregation to their default.
|
protected java.lang.Object |
clone() |
java.util.List<java.lang.Object[]> |
getData()
Returns details of the aggregation in a tabular format which can be serialized across the wire and formatted for
display.
|
java.util.List<AggregationKey> |
getKeyData()
Returns a list of the AggregationKeys that belong to this aggregation.
|
java.lang.Long |
getValueForKey(AggregationKey key)
Returns a value for the given key if the key has a value associated with it.
|
void |
truncate(int count)
Reduces the size of the aggregation to the absolute value of
count . |
public Aggregation(AggregationFunction type)
type
- the type of aggregation function to usepublic void add(long data)
data
- the value to be addedpublic void add(AggregationKey key, long data)
key
- the aggregation keydata
- the value to be addedpublic void clear()
public void truncate(int count)
count
. If count is greater than
zero, the largest aggregated values are preserved. If it is less than zero, the smallest aggregated values are
preserved. Passing a value of zero clears the aggregation completely.count
- the absolute number indicates the number of aggregated values to preserve.public java.util.List<java.lang.Object[]> getData()
public java.util.List<AggregationKey> getKeyData()
public java.lang.Long getValueForKey(AggregationKey key)
key
- protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException