prefuse.util.collections
Class ObjectIntTreeMap

java.lang.Object
  extended by prefuse.util.collections.AbstractTreeMap
      extended by prefuse.util.collections.ObjectIntTreeMap
All Implemented Interfaces:
IntSortedMap, ObjectIntSortedMap

public class ObjectIntTreeMap
extends AbstractTreeMap
implements ObjectIntSortedMap

Sorted map implementation using a red-black tree to map from Object keys to int values.

Author:
jeffrey heer

Nested Class Summary
 
Nested classes/interfaces inherited from class prefuse.util.collections.AbstractTreeMap
AbstractTreeMap.Entry, AbstractTreeMap.EntryIterator, AbstractTreeMap.KeyIterator, AbstractTreeMap.ValueIterator
 
Field Summary
 
Fields inherited from class prefuse.util.collections.AbstractTreeMap
allowDuplicates, BLACK, lastOrder, modCount, NIL, RED, root, size, unique
 
Fields inherited from interface prefuse.util.collections.ObjectIntSortedMap
MAX_KEY, MIN_KEY
 
Constructor Summary
ObjectIntTreeMap()
           
ObjectIntTreeMap(boolean allowDuplicates)
           
ObjectIntTreeMap(java.util.Comparator comparator)
           
ObjectIntTreeMap(java.util.Comparator comparator, boolean allowDuplicates)
           
 
Method Summary
 java.util.Comparator comparator()
           
protected  int compare(AbstractTreeMap.Entry e1, AbstractTreeMap.Entry e2)
           
 boolean containsKey(java.lang.Object key)
           
 java.lang.Object firstKey()
           
 int get(java.lang.Object key)
           
 java.util.Iterator keyIterator()
           
 java.util.Iterator keyRangeIterator(java.lang.Object fromKey, boolean fromInc, java.lang.Object toKey, boolean toInc)
           
 java.lang.Object lastKey()
           
 int put(java.lang.Object key, int value)
           
 int remove(java.lang.Object key)
           
 int remove(java.lang.Object key, int val)
           
 IntIterator valueRangeIterator(java.lang.Object fromKey, boolean fromInc, java.lang.Object toKey, boolean toInc)
           
 
Methods inherited from class prefuse.util.collections.AbstractTreeMap
clear, containsValue, decrementSize, find, findCeiling, findPredecessor, fixUpInsert, fixUpRemove, getMaximum, getMedian, getMinimum, getUniqueCount, incrementSize, isAllowDuplicates, isEmpty, maximum, minimum, predecessor, remove, rotateLeft, rotateRight, size, successor, valueIterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface prefuse.util.collections.IntSortedMap
clear, containsValue, getMaximum, getMedian, getMinimum, getUniqueCount, isAllowDuplicates, isEmpty, size, valueIterator
 

Constructor Detail

ObjectIntTreeMap

public ObjectIntTreeMap()

ObjectIntTreeMap

public ObjectIntTreeMap(boolean allowDuplicates)

ObjectIntTreeMap

public ObjectIntTreeMap(java.util.Comparator comparator)

ObjectIntTreeMap

public ObjectIntTreeMap(java.util.Comparator comparator,
                        boolean allowDuplicates)
Method Detail

comparator

public java.util.Comparator comparator()
Specified by:
comparator in interface IntSortedMap
Overrides:
comparator in class AbstractTreeMap
See Also:
SortedMap.comparator()

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface ObjectIntSortedMap
See Also:
Map.containsKey(java.lang.Object)

get

public int get(java.lang.Object key)
Specified by:
get in interface ObjectIntSortedMap
See Also:
Map.get(java.lang.Object)

put

public int put(java.lang.Object key,
               int value)
Specified by:
put in interface ObjectIntSortedMap
See Also:
Map.put(java.lang.Object, java.lang.Object)

remove

public int remove(java.lang.Object key)
Specified by:
remove in interface ObjectIntSortedMap
See Also:
Map.remove(java.lang.Object)

remove

public int remove(java.lang.Object key,
                  int val)
Specified by:
remove in interface ObjectIntSortedMap

firstKey

public java.lang.Object firstKey()
Specified by:
firstKey in interface ObjectIntSortedMap
See Also:
SortedMap.firstKey()

lastKey

public java.lang.Object lastKey()
Specified by:
lastKey in interface ObjectIntSortedMap
See Also:
SortedMap.lastKey()

keyIterator

public java.util.Iterator keyIterator()
Specified by:
keyIterator in interface ObjectIntSortedMap

keyRangeIterator

public java.util.Iterator keyRangeIterator(java.lang.Object fromKey,
                                           boolean fromInc,
                                           java.lang.Object toKey,
                                           boolean toInc)
Specified by:
keyRangeIterator in interface ObjectIntSortedMap

valueRangeIterator

public IntIterator valueRangeIterator(java.lang.Object fromKey,
                                      boolean fromInc,
                                      java.lang.Object toKey,
                                      boolean toInc)
Specified by:
valueRangeIterator in interface ObjectIntSortedMap

compare

protected int compare(AbstractTreeMap.Entry e1,
                      AbstractTreeMap.Entry e2)
Specified by:
compare in class AbstractTreeMap


Copyright © 2007 Regents of the University of California