public final class DoubleSumAggregator<I> extends AbstractAggregator<I,Number,Double> implements IdentifiedDataSerializable
attributePath
Constructor and Description |
---|
DoubleSumAggregator() |
DoubleSumAggregator(String attributePath) |
Modifier and Type | Method and Description |
---|---|
void |
accumulateExtracted(I entry,
Number value)
Accumulates a single extracted value.
|
Double |
aggregate()
Returns the result of the aggregation.
|
void |
combine(Aggregator aggregator)
Incorporates the intermediary result of the given aggregator to this instance of the aggregator.
|
boolean |
equals(Object o) |
int |
getClassId()
Returns type identifier for this class.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
hashCode() |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
accumulate
onAccumulationFinished, onCombinationFinished
public DoubleSumAggregator()
public DoubleSumAggregator(String attributePath)
public void accumulateExtracted(I entry, Number value)
AbstractAggregator
accumulateExtracted
in class AbstractAggregator<I,Number,Double>
entry
- The entry containing the value.value
- If attributePath is not null the methods accumulates the value extracted from the attributePath.
If attributePath is null and the input object is a Map.Entry the method accumulates Map.Entry.getValue().public void combine(Aggregator aggregator)
Aggregator
combine
in class Aggregator<I,Double>
aggregator
- aggregator providing intermediary results to be combined into the results of this aggregator.
The given aggregator has to be of the same class as the one that the method is being called on.public Double aggregate()
Aggregator
aggregate
in class Aggregator<I,Double>
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getClassId()
IdentifiedDataSerializable
getClassId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.public boolean equals(Object o)
equals
in class AbstractAggregator<I,Number,Double>
public int hashCode()
hashCode
in class AbstractAggregator<I,Number,Double>
Copyright © 2019 Hazelcast, Inc.. All rights reserved.