tango.util.collection.TreeMap

class TreeMap(K, T) : MapCollection!(K, T), SortedKeys!(K, T) #
RedBlack Trees of (key, element) pairs

Author:

Doug Lea @version 0.93

For an introduction to this package see Overview .

RBPairT tree [package] #
The root of the tree. Null if empty.
ComparatorT cmp [protected] #
The Comparator to use for ordering
this() [public] #
Make an empty tree, using DefaultComparator for ordering
this(Predicate screener) [public] #
Make an empty tree, using given screener for screening elements (not keys)
this(ComparatorT c) [public] #
Make an empty tree, using given Comparator for ordering
this(Predicate s, ComparatorT c) [public] #
Make an empty tree, using given screener and Comparator.
this(Predicate s, ComparatorT c, RBPairT t, int n) [protected] #
Special version of constructor needed by clone()
int compareKey(K fst, K snd) [private, final] #
The default key comparator
@param fst first argument @param snd second argument

Returns:

a negative number if fst is less than snd; a positive number if fst is greater than snd; else 0
int compareElem(T fst, T snd) [private, final] #
The default element comparator
@param fst first argument @param snd second argument

Returns:

a negative number if fst is less than snd; a positive number if fst is greater than snd; else 0
TreeMap!(K, T) duplicate() [public] #
Create an independent copy. Does not clone elements.
bool contains(T element) [public, final] #
Implements tango.util.collection.impl.Collection.Collection.contains Time complexity: O(log n).

See Also:

tango.util.collection.impl.Collection.Collection.contains
uint instances(T element) [public, final] #
Implements tango.util.collection.impl.Collection.Collection.instances Time complexity: O(log n).

See Also:

tango.util.collection.impl.Collection.Collection.instances
GuardIterator!(T) elements() [public, final] #
Implements tango.util.collection.impl.Collection.Collection.elements Time complexity: O(1).

See Also:

tango.util.collection.impl.Collection.Collection.elements
int opApply(int delegate (inout T value) dg) #
Implements tango.util.collection.model.View.View.opApply Time complexity: O(n)

See Also:

tango.util.collection.model.View.View.opApply
int opApply(int delegate (inout K key, inout T value) dg) #
Implements tango.util.collection.MapView.opApply Time complexity: O(n)

See Also:

tango.util.collection.MapView.opApply
ComparatorT comparator() [public, final] #
Implements tango.util.collection.KeySortedCollection.comparator Time complexity: O(1).

See Also:

tango.util.collection.KeySortedCollection.comparator
void comparator(ComparatorT c) [public, final] #
Use a new Comparator. Causes a reorganization
bool containsKey(K key) [public, final] #
Implements tango.util.collection.Map.containsKey. Time complexity: O(log n).

See Also:

tango.util.collection.Map.containsKey
bool containsPair(K key, T element) [public, final] #
Implements tango.util.collection.Map.containsPair. Time complexity: O(n).

See Also:

tango.util.collection.Map.containsPair
PairIterator!(K, T) keys() [public, final] #
Implements tango.util.collection.Map.keys. Time complexity: O(1).

See Also:

tango.util.collection.Map.keys
T get(K key) [public, final] #
Implements tango.util.collection.Map.get. Time complexity: O(log n).

See Also:

tango.util.collection.Map.get
bool get(K key, inout T value) [public, final] #
Return the element associated with Key key. @param key a key

Returns:

whether the key is contained or not
bool keyOf(inout K key, T value) [public, final] #
Implements tango.util.collection.Map.keyOf. Time complexity: O(n).

See Also:

tango.util.collection.Map.keyOf
void clear() [public, final] #
Implements tango.util.collection.impl.Collection.Collection.clear. Time complexity: O(1).

See Also:

tango.util.collection.impl.Collection.Collection.clear
void removeAll(T element) [public, final] #
Implements tango.util.collection.impl.Collection.Collection.removeAll. Time complexity: O(n).

See Also:

tango.util.collection.impl.Collection.Collection.removeAll
void remove(T element) [public, final] #
Implements tango.util.collection.impl.Collection.Collection.removeOneOf. Time complexity: O(n).

See Also:

tango.util.collection.impl.Collection.Collection.removeOneOf
void replace(T oldElement, T newElement) [public, final] #
Implements tango.util.collection.impl.Collection.Collection.replaceOneOf. Time complexity: O(n).

See Also:

tango.util.collection.impl.Collection.Collection.replaceOneOf
void replaceAll(T oldElement, T newElement) [public, final] #
Implements tango.util.collection.impl.Collection.Collection.replaceAllOf. Time complexity: O(n).

See Also:

tango.util.collection.impl.Collection.Collection.replaceAllOf
T take() [public, final] #
Implements tango.util.collection.impl.Collection.Collection.take. Time complexity: O(log n). Takes the element associated with the least key.

See Also:

tango.util.collection.impl.Collection.Collection.take
void add(K key, T element) [public, final] #
Implements tango.util.collection.impl.MapCollection.MapCollection.add. Time complexity: O(log n).

See Also:

tango.util.collection.impl.MapCollection.MapCollection.add
void removeKey(K key) [public, final] #
Implements tango.util.collection.impl.MapCollection.MapCollection.remove. Time complexity: O(log n).

See Also:

tango.util.collection.impl.MapCollection.MapCollection.remove
void replacePair(K key, T oldElement, T newElement) [public, final] #
Implements tango.util.collection.impl.MapCollection.MapCollection.replaceElement. Time complexity: O(log n).

See Also:

tango.util.collection.impl.MapCollection.MapCollection.replaceElement
void checkImplementation() [public, override] #
Implements tango.util.collection.model.View.View.checkImplementation.

See Also:

tango.util.collection.model.View.View.checkImplementation
class MapIterator(K, V) : AbstractMapIterator!(K, V) #
opApply() has migrated here to mitigate the virtual call on method get()