Package com.tangosol.util.aggregator
Class Count<K,V> 
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.aggregator.Count<K,V> 
- All Implemented Interfaces:
- ExternalizableLite,- PortableObject,- InvocableMap.EntryAggregator<K,,- V, - Integer> - InvocableMap.StreamingAggregator<K,,- V, - Integer, - Integer> - Serializable
public class Count<K,V> 
extends Base
implements InvocableMap.StreamingAggregator<K,V,Integer,Integer>, ExternalizableLite, PortableObject   
Calculates a number of values in an entry set.
- Since:
- Coherence 3.1
- Author:
- gg 2005.09.05
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class com.tangosol.util.BaseBase.LoggingWriter
- 
Field SummaryFields inherited from class com.tangosol.util.BaseDEFAULT_LOAD_FACTOR, LOG_ALWAYS, LOG_CONFIG, LOG_DEBUG, LOG_ERR, LOG_INFO, LOG_MAX, LOG_MIN, LOG_QUIET, LOG_WARN, POWER_0, POWER_G, POWER_K, POWER_M, POWER_T, UNIT_D, UNIT_H, UNIT_M, UNIT_MS, UNIT_NS, UNIT_S, UNIT_USFields inherited from interface com.tangosol.util.InvocableMap.StreamingAggregatorALLOW_INCONSISTENCIES, BY_MEMBER, BY_PARTITION, PARALLEL, PRESENT_ONLY, RETAINS_ENTRIES, SERIAL
- 
Constructor SummaryConstructorsConstructorDescriptionCount()Default constructor (necessary for the ExternalizableLite interface).
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaccumulate(InvocableMap.Entry<? extends K, ? extends V> entry) Accumulate one entry into the result.booleanaccumulate(Streamer<? extends InvocableMap.Entry<? extends K, ? extends V>> streamer) Accumulate multiple entries into the result.intA bit mask representing the set of characteristics of this aggregator.booleanMerge another partial result into the result.Return the final result of the aggregation.Return the partial result of the aggregation.voidRestore the contents of a user type instance by reading its state using the specified PofReader object.voidRestore the contents of this object by loading the object's state from the passed DataInput object.supply()Create a new instance of this aggregator.voidwriteExternal(PofWriter out) Save the contents of a POF user type instance by writing its state using the specified PofWriter object.voidwriteExternal(DataOutput out) Save the contents of this object by storing the object's state into the passed DataOutput object.Methods inherited from class com.tangosol.util.Baseazzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, newHashMap, newHashMap, newHashSet, newHashSet, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, waitMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tangosol.util.InvocableMap.StreamingAggregatoraggregate, isAllowInconsistencies, isByMember, isByPartition, isParallel, isPresentOnly, isRetainsEntries, isSerial
- 
Constructor Details- 
Countpublic Count()Default constructor (necessary for the ExternalizableLite interface).
 
- 
- 
Method Details- 
supplyDescription copied from interface:InvocableMap.StreamingAggregatorCreate a new instance of this aggregator.
- 
accumulateDescription copied from interface:InvocableMap.StreamingAggregatorAccumulate multiple entries into the result.Important note: The default implementation of this method provides necessary logic for aggregation short-circuiting and should rarely (if ever) be overridden by the custom aggregator implementation. - Specified by:
- accumulatein interface- InvocableMap.StreamingAggregator<K,- V, - Integer, - Integer> 
- Parameters:
- streamer- a- Streamerthat can be used to iterate over entries to add
- Returns:
- trueto continue the aggregation, and- falseto signal to the caller that the result is ready and the aggregation can be short-circuited
 
- 
accumulateDescription copied from interface:InvocableMap.StreamingAggregatorAccumulate one entry into the result.- Specified by:
- accumulatein interface- InvocableMap.StreamingAggregator<K,- V, - Integer, - Integer> 
- Parameters:
- entry- the entry to accumulate into the aggregation result
- Returns:
- trueto continue the aggregation, and- falseto signal to the caller that the result is ready and the aggregation can be short-circuited
 
- 
combineDescription copied from interface:InvocableMap.StreamingAggregatorMerge another partial result into the result.
- 
getPartialResultDescription copied from interface:InvocableMap.StreamingAggregatorReturn the partial result of the aggregation.- Specified by:
- getPartialResultin interface- InvocableMap.StreamingAggregator<K,- V, - Integer, - Integer> 
- Returns:
- the partial result of the aggregation
 
- 
finalizeResultDescription copied from interface:InvocableMap.StreamingAggregatorReturn the final result of the aggregation.- Specified by:
- finalizeResultin interface- InvocableMap.StreamingAggregator<K,- V, - Integer, - Integer> 
- Returns:
- the final result of the aggregation
 
- 
characteristicspublic int characteristics()Description copied from interface:InvocableMap.StreamingAggregatorA bit mask representing the set of characteristics of this aggregator.By default, characteristics are a combination of InvocableMap.StreamingAggregator.PARALLELandInvocableMap.StreamingAggregator.RETAINS_ENTRIES, which is sub-optimal and should be overridden by the aggregator implementation if the aggregator does not need to retain entries (which is often the case).- Specified by:
- characteristicsin interface- InvocableMap.StreamingAggregator<K,- V, - Integer, - Integer> 
- Returns:
- a bit mask representing the set of characteristics of this aggregator
- See Also:
 
- 
readExternalRestore the contents of this object by loading the object's state from the passed DataInput object.- Specified by:
- readExternalin interface- ExternalizableLite
- Parameters:
- in- the DataInput stream to read data from in order to restore the state of this object
- Throws:
- IOException- if an I/O exception occurs
 
- 
writeExternalSave the contents of this object by storing the object's state into the passed DataOutput object.- Specified by:
- writeExternalin interface- ExternalizableLite
- Parameters:
- out- the DataOutput stream to write the state of this object to
- Throws:
- IOException- if an I/O exception occurs
 
- 
readExternalRestore the contents of a user type instance by reading its state using the specified PofReader object.- Specified by:
- readExternalin interface- PortableObject
- Parameters:
- in- the PofReader from which to read the object's state
- Throws:
- IOException- if an I/O error occurs
 
- 
writeExternalSave the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
- writeExternalin interface- PortableObject
- Parameters:
- out- the PofWriter to which to write the object's state
- Throws:
- IOException- if an I/O error occurs
 
 
-