org.knowceans.map
Class IndexRanking

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.TreeMap<X,java.util.Set<Y>>
          extended by org.knowceans.map.TreeMultiMap<X,Y>
              extended by org.knowceans.map.InvertibleTreeMultiMap<K,V>
                  extended by org.knowceans.map.RankingMap<java.lang.Double,java.lang.Integer>
                      extended by org.knowceans.map.IndexRanking
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Double,java.util.Set<java.lang.Integer>>, java.util.NavigableMap<java.lang.Double,java.util.Set<java.lang.Integer>>, java.util.SortedMap<java.lang.Double,java.util.Set<java.lang.Integer>>, IMultiMap<java.lang.Double,java.lang.Integer>

public class IndexRanking
extends RankingMap<java.lang.Double,java.lang.Integer>

IndexSorter is a convenience class that sorts Integer indices (values) by their scores (keys).

Author:
gregor
See Also:
Serialized Form

Nested Class Summary
 class IndexRanking.IndexEntry
           
 
Nested classes/interfaces inherited from class org.knowceans.map.RankingMap
RankingMap.RankEntry
 
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
IndexRanking()
           
IndexRanking(boolean reverse)
           
IndexRanking(java.util.Comparator<? super java.lang.Double> comp)
           
IndexRanking(IMultiMap<java.lang.Double,java.lang.Integer> map)
           
IndexRanking(IMultiMap<java.lang.Double,java.lang.Integer> map, java.util.Comparator<? super java.lang.Double> comp)
           
 
Method Summary
 java.util.List<IndexRanking.IndexEntry> entryList()
           
 java.util.List<IndexRanking.IndexEntry> entryList(int count)
          Get sorted key-value pairs with duplicate scores resolved
 IndexRanking headMap(java.lang.Double fromKey)
           
 IndexRanking headMap(int count)
          creates a new map with count values referenced (but not
 IndexRanking tailMap(java.lang.Double fromKey)
           
 
Methods inherited from class org.knowceans.map.RankingMap
main, put, put, sortedKeys, sortedKeys, sortedValues, sortedValues
 
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

IndexRanking

public IndexRanking()

IndexRanking

public IndexRanking(boolean reverse)
Parameters:
reverse -

IndexRanking

public IndexRanking(java.util.Comparator<? super java.lang.Double> comp)
Parameters:
comp -

IndexRanking

public IndexRanking(IMultiMap<java.lang.Double,java.lang.Integer> map,
                    java.util.Comparator<? super java.lang.Double> comp)
Parameters:
map -
comp -

IndexRanking

public IndexRanking(IMultiMap<java.lang.Double,java.lang.Integer> map)
Parameters:
map -
Method Detail

headMap

public IndexRanking headMap(int count)
creates a new map with count values referenced (but not

Overrides:
headMap in class RankingMap<java.lang.Double,java.lang.Integer>
Parameters:
count -

entryList

public java.util.List<IndexRanking.IndexEntry> entryList(int count)
Get sorted key-value pairs with duplicate scores resolved

Overrides:
entryList in class RankingMap<java.lang.Double,java.lang.Integer>
Parameters:
count - maximum number of entries returned
Returns:

entryList

public java.util.List<IndexRanking.IndexEntry> entryList()
Overrides:
entryList in class RankingMap<java.lang.Double,java.lang.Integer>

headMap

public IndexRanking headMap(java.lang.Double fromKey)
Specified by:
headMap in interface java.util.NavigableMap<java.lang.Double,java.util.Set<java.lang.Integer>>
Specified by:
headMap in interface java.util.SortedMap<java.lang.Double,java.util.Set<java.lang.Integer>>
Overrides:
headMap in class RankingMap<java.lang.Double,java.lang.Integer>

tailMap

public IndexRanking tailMap(java.lang.Double fromKey)
Specified by:
tailMap in interface java.util.NavigableMap<java.lang.Double,java.util.Set<java.lang.Integer>>
Specified by:
tailMap in interface java.util.SortedMap<java.lang.Double,java.util.Set<java.lang.Integer>>
Overrides:
tailMap in class RankingMap<java.lang.Double,java.lang.Integer>