Package org.apache.storm.starter.tools
Class Rankings
java.lang.Object
org.apache.storm.starter.tools.Rankings
- All Implemented Interfaces:
- Serializable
- See Also:
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
Rankingspublic Rankings()
- 
Rankingspublic Rankings(int topN) 
- 
RankingsCopy constructor.
 
- 
- 
Method Details- 
maxSizepublic int maxSize()Get max size.- Returns:
- the maximum possible number (size) of ranked objects this instance can hold
 
- 
sizepublic int size()Get size.- Returns:
- the number (size) of ranked objects this instance is currently holding
 
- 
getRankingsThe returned defensive copy is only "somewhat" defensive. We do, for instance, return a defensive copy of the enclosing List instance, and we do try to defensively copy any contained Rankable objects, too. However, the contract ofRankable.copy()does not guarantee that any Object's embedded within a Rankable will be defensively copied, too.- Returns:
- a somewhat defensive copy of ranked items
 
- 
updateWith
- 
updateWith
- 
pruneZeroCountspublic void pruneZeroCounts()Removes ranking entries that have a count of zero.
- 
toString
- 
copyCreates a (defensive) copy of itself.
 
-