|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.TreeMap<X,java.util.Set<Y>> org.knowceans.map.TreeMultiMap<X,Y> org.knowceans.map.InvertibleTreeMultiMap<K,V> org.knowceans.map.RankingMap<K,V>
public class RankingMap<K,V>
RankingMap allows sorting of two lists of items simultaneously.
TODO: build ParallelCollection (or for primitive types a ParallelArray)
Nested Class Summary | |
---|---|
class |
RankingMap.RankEntry
RankEntry is a special pendent to Map.Entry with a wider purpose and validity also after change of the RankingMap |
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Constructor Summary | |
---|---|
RankingMap()
|
|
RankingMap(boolean reverse)
Init with reverse ordering (reverse is not evaluated). |
|
RankingMap(java.util.Comparator<? super K> comp)
Init and specify Comparator for keys. |
|
RankingMap(java.util.Map<K,java.util.Set<V>> map)
Create a ranking map from the map. |
|
RankingMap(java.util.Map<K,java.util.Set<V>> map,
java.util.Comparator<? super K> comp)
Create a ranking map from the map. |
Method Summary | |
---|---|
java.util.List<? extends RankingMap.RankEntry> |
entryList()
|
java.util.List<? extends RankingMap.RankEntry> |
entryList(int count)
Get sorted key-value pairs with duplicate scores resolved |
RankingMap<K,V> |
headMap(int count)
creates a new map with count values referenced (but not |
RankingMap<K,V> |
headMap(K fromKey)
|
static void |
main(java.lang.String[] args)
|
void |
put(K[] keys,
V[] values)
Put the two arrays (of equal size) into the map |
void |
put(java.util.List<K> keys,
java.util.List<V> values)
put keys and values |
java.util.List<K> |
sortedKeys()
Get sorted keys. |
java.util.List<K> |
sortedKeys(int count)
Get a maximum of count sorted keys. |
java.util.List<V> |
sortedValues()
Get sorted values |
java.util.List<V> |
sortedValues(int count)
Get a maximum of count sorted values. |
RankingMap<K,V> |
tailMap(K fromKey)
|
Methods inherited from class org.knowceans.map.InvertibleTreeMultiMap |
---|
add, clear, getInverse, getInverse, getInverseValue, put, remove, remove |
Methods inherited from class java.util.TreeMap |
---|
ceilingEntry, ceilingKey, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, get, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, putAll, size, subMap, subMap, tailMap, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, isEmpty, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, size, values |
Constructor Detail |
---|
public RankingMap()
public RankingMap(boolean reverse)
public RankingMap(java.util.Comparator<? super K> comp)
comp
- public RankingMap(java.util.Map<K,java.util.Set<V>> map)
map
- public RankingMap(java.util.Map<K,java.util.Set<V>> map, java.util.Comparator<? super K> comp)
map
- Method Detail |
---|
public static void main(java.lang.String[] args)
public java.util.List<K> sortedKeys(int count)
count
-
public java.util.List<K> sortedKeys()
public java.util.List<? extends RankingMap.RankEntry> entryList(int count)
count
- maximum number of entries returned
public java.util.List<? extends RankingMap.RankEntry> entryList()
public java.util.List<V> sortedValues(int count)
count
-
public java.util.List<V> sortedValues()
public RankingMap<K,V> headMap(int count)
count
- public RankingMap<K,V> headMap(K fromKey)
headMap
in interface java.util.NavigableMap<K,java.util.Set<V>>
headMap
in interface java.util.SortedMap<K,java.util.Set<V>>
headMap
in class java.util.TreeMap<K,java.util.Set<V>>
public RankingMap<K,V> tailMap(K fromKey)
tailMap
in interface java.util.NavigableMap<K,java.util.Set<V>>
tailMap
in interface java.util.SortedMap<K,java.util.Set<V>>
tailMap
in class java.util.TreeMap<K,java.util.Set<V>>
public void put(K[] keys, V[] values)
keys
- values
- public void put(java.util.List<K> keys, java.util.List<V> values)
keys
- values
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |