public abstract class BaseNumberNestedAggregate<Node,Type,Context extends BaseNumberNestedAggregate.BaseContext<Type,Node>> extends java.lang.Object implements NestedAggregate<Node,Context>
Subclasses can optimize based on an expected primitive type while still honoring the Long.class and
Long.TYPE semantics around null or 0 empty values.
Note that subclasses can also be independent of the Node type (JSON etc). All Node specific operations
are passed back to the NestedCoercibleType instance.
| Modifier and Type | Class and Description |
|---|---|
static class |
BaseNumberNestedAggregate.BaseContext<Type,Node> |
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Class<Type> |
aggregateType |
protected cascading.tuple.Fields |
fieldDeclaration |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseNumberNestedAggregate() |
protected |
BaseNumberNestedAggregate(cascading.tuple.Fields fieldDeclaration,
java.lang.Class<Type> defaultType) |
| Modifier and Type | Method and Description |
|---|---|
void |
aggregate(Context context,
Node node)
This method receives each collected value to be applied to the current aggregation.
|
cascading.tuple.Tuple |
complete(Context context)
This method completes the aggregate operation and insert the results into a Tuple instance.
|
protected boolean |
discardNullValues() |
cascading.tuple.Fields |
getFieldDeclaration() |
Context |
resetContext(Context context)
This method is called after
NestedAggregate.complete(Object) so that any resources can be freed and the result
context instance can be used in the next aggregation. |
protected boolean |
returnNullForEmpty() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateContextprotected cascading.tuple.Fields fieldDeclaration
protected java.lang.Class<Type> aggregateType
protected BaseNumberNestedAggregate()
protected BaseNumberNestedAggregate(cascading.tuple.Fields fieldDeclaration, java.lang.Class<Type> defaultType)
public cascading.tuple.Fields getFieldDeclaration()
getFieldDeclaration in interface NestedAggregate<Node,Context extends BaseNumberNestedAggregate.BaseContext<Type,Node>>protected boolean returnNullForEmpty()
protected boolean discardNullValues()
public void aggregate(Context context, Node node)
NestedAggregateaggregate in interface NestedAggregate<Node,Context extends BaseNumberNestedAggregate.BaseContext<Type,Node>>context - the context object created by NestedAggregate.createContext(CoercibleType)node - the Node container object that should be aggregatedpublic cascading.tuple.Tuple complete(Context context)
NestedAggregate
Note the Tuple may be created (indirectly) by the NestedAggregate.createContext(CoercibleType) method and reused.
complete in interface NestedAggregate<Node,Context extends BaseNumberNestedAggregate.BaseContext<Type,Node>>context - the context object created by NestedAggregate.createContext(CoercibleType)public Context resetContext(Context context)
NestedAggregateNestedAggregate.complete(Object) so that any resources can be freed and the result
context instance can be used in the next aggregation.resetContext in interface NestedAggregate<Node,Context extends BaseNumberNestedAggregate.BaseContext<Type,Node>>context - the context object created by NestedAggregate.createContext(CoercibleType)Copyright © 2007-2021 Cascading Maintainers. All Rights Reserved.