public class Rankings extends Object implements Serializable
Constructor and Description |
---|
Rankings() |
Rankings(int topN) |
Rankings(Rankings other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
Rankings |
copy()
Creates a (defensive) copy of itself.
|
List<Rankable> |
getRankings()
The returned defensive copy is only “somewhat” defensive.
|
int |
maxSize() |
void |
pruneZeroCounts()
Removes ranking entries that have a count of zero.
|
int |
size() |
String |
toString() |
void |
updateWith(Rankable r) |
void |
updateWith(Rankings other) |
public Rankings()
public Rankings(int topN)
public Rankings(Rankings other)
Copy constructor.
other
- public int maxSize()
public int size()
public List<Rankable> getRankings()
The 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 of Rankable.copy()
does not guarantee that any Object’s embedded within a Rankable will be defensively copied, too.
public void updateWith(Rankings other)
public void updateWith(Rankable r)
public void pruneZeroCounts()
Removes ranking entries that have a count of zero.
public Rankings copy()
Creates a (defensive) copy of itself.
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.