public class TopNSet extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected String |
largestKnownKey |
protected long |
largestKnownValue |
protected int |
maxsize |
protected ConcurrentMap<String,Long> |
set |
protected String |
smallestKnownKey |
protected long |
smallestKnownValue |
Constructor and Description |
---|
TopNSet(int size) |
Modifier and Type | Method and Description |
---|---|
SortedSet<Map.Entry<?,Long>> |
getEntriesDescending()
Get descending ordered list of key,count Entries.
|
String |
getLargest() |
int |
getMaxSize() |
String |
getSmallest() |
ConcurrentMap<String,Long> |
getTopSet()
Make internal map available (for checkpoint/restore purposes).
|
void |
setMaxSize(int max) |
int |
size() |
void |
update(String key,
long value)
Update the given String key with a new total value, perhaps displacing
an existing top-valued entry, and updating the fields recording max/min
keys in any case.
|
void |
updateBounds()
After an operation invalidating the previous largest/smallest entry,
find the new largest/smallest.
|
protected int maxsize
protected ConcurrentMap<String,Long> set
protected volatile long smallestKnownValue
protected volatile String smallestKnownKey
protected volatile long largestKnownValue
protected volatile String largestKnownKey
public void update(String key, long value)
key
- String key to updatevalue
- long new total value (*not* increment/decrement)public String getLargest()
public String getSmallest()
public void updateBounds()
public ConcurrentMap<String,Long> getTopSet()
public int size()
public SortedSet<Map.Entry<?,Long>> getEntriesDescending()
public int getMaxSize()
public void setMaxSize(int max)
Copyright © 2003-2014 Internet Archive. All Rights Reserved.