prefuse.util.collections
Class DoubleIntTreeMap

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

public class DoubleIntTreeMap
extends AbstractTreeMap
implements DoubleIntSortedMap

Sorted map implementation using a red-black tree to map from double 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.ValueIterator
 
Field Summary
 
Fields inherited from class prefuse.util.collections.AbstractTreeMap
allowDuplicates, BLACK, cmp, lastOrder, modCount, NIL, RED, root, size, unique
 
Constructor Summary
DoubleIntTreeMap()
           
DoubleIntTreeMap(boolean allowDuplicates)
           
DoubleIntTreeMap(LiteralComparator comparator)
           
DoubleIntTreeMap(LiteralComparator comparator, boolean allowDuplicates)
           
 
Method Summary
 void clear()
           
protected  int compare(AbstractTreeMap.Entry e1, AbstractTreeMap.Entry e2)
           
 boolean containsKey(double key)
           
 double firstKey()
           
 int get(double key)
           
 LiteralIterator keyIterator()
           
 LiteralIterator keyRangeIterator(double fromKey, boolean fromInc, double toKey, boolean toInc)
           
 double lastKey()
           
 int put(double key, int value)
           
 int remove(double key)
           
 int remove(double key, int val)
           
 IntIterator valueRangeIterator(double fromKey, boolean fromInc, double toKey, boolean toInc)
           
 
Methods inherited from class prefuse.util.collections.AbstractTreeMap
comparator, 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
comparator, containsValue, getMaximum, getMedian, getMinimum, getUniqueCount, isAllowDuplicates, isEmpty, size, valueIterator
 

Constructor Detail

DoubleIntTreeMap

public DoubleIntTreeMap()

DoubleIntTreeMap

public DoubleIntTreeMap(boolean allowDuplicates)

DoubleIntTreeMap

public DoubleIntTreeMap(LiteralComparator comparator)

DoubleIntTreeMap

public DoubleIntTreeMap(LiteralComparator comparator,
                        boolean allowDuplicates)
Method Detail

clear

public void clear()
Specified by:
clear in interface IntSortedMap
Overrides:
clear in class AbstractTreeMap
See Also:
Map.clear()

containsKey

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

get

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

put

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

remove

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

remove

public int remove(double key,
                  int val)
Specified by:
remove in interface DoubleIntSortedMap

firstKey

public double firstKey()
Specified by:
firstKey in interface DoubleIntSortedMap
See Also:
SortedMap.firstKey()

lastKey

public double lastKey()
Specified by:
lastKey in interface DoubleIntSortedMap
See Also:
SortedMap.lastKey()

keyIterator

public LiteralIterator keyIterator()
Specified by:
keyIterator in interface DoubleIntSortedMap

keyRangeIterator

public LiteralIterator keyRangeIterator(double fromKey,
                                        boolean fromInc,
                                        double toKey,
                                        boolean toInc)
Specified by:
keyRangeIterator in interface DoubleIntSortedMap

valueRangeIterator

public IntIterator valueRangeIterator(double fromKey,
                                      boolean fromInc,
                                      double toKey,
                                      boolean toInc)
Specified by:
valueRangeIterator in interface DoubleIntSortedMap

compare

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


Copyright © 2007 Regents of the University of California