|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
edu.umd.cloud9.util.Scorekeeper<K,V>
K - type of keypublic class Scorekeeper<K extends Comparable<K>,V extends Number & Comparable<V>>
An object that holds scores associated with each object (the key) and supports iteration by score (descending). Many applications call for this type of functionality, e.g., keeping track of the score of each document in an document retrieval application.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Constructor Summary | |
|---|---|
Scorekeeper()
Constructs a ScoreSortedMap. |
|
| Method Summary | |
|---|---|
Map.Entry<K,V> |
getEntryByRank(int i)
Returns the ith scoring entry. |
SortedSet<Map.Entry<K,V>> |
getSortedEntries()
Returns the all entries sorted by scores. |
SortedSet<Map.Entry<K,V>> |
getSortedEntries(int n)
Returns the n top entries sorted by scores. |
List<K> |
getSortedKeys()
Returns a list of the keys, sorted by score. |
Map.Entry<K,V> |
getTopEntry()
Returns the top-scoring entry. |
| Methods inherited from class java.util.HashMap |
|---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public Scorekeeper()
ScoreSortedMap.
| Method Detail |
|---|
public SortedSet<Map.Entry<K,V>> getSortedEntries()
public SortedSet<Map.Entry<K,V>> getSortedEntries(int n)
n - number of entries to retrieve
public Map.Entry<K,V> getTopEntry()
public Map.Entry<K,V> getEntryByRank(int i)
i - the rank
public List<K> getSortedKeys()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||