• 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 ;
  • The root of the tree . Null if empty.

  • ComparatorT cmp ;
  • The Comparator to use for ordering

  • this();
  • Make an empty tree, using DefaultComparator for ordering

  • this(Predicate screener);
  • Make an empty tree, using given screener for screening elements (not keys)

  • this(ComparatorT c);
  • Make an empty tree, using given Comparator for ordering

  • this(Predicate s, ComparatorT c);
  • Make an empty tree, using given screener and Comparator.

  • this(Predicate s, ComparatorT c, RBPairT t, int n);
  • Special version of constructor needed by clone()

  • int compareKey (K fst, K snd);
  • 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);
  • 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 ();
  • Create an independent copy. Does not clone elements.

  • bool contains (T element);
  • 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);
  • 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 ();
  • 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(ref 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(ref K key, ref T value) dg);
  • Implements tango.util.collection.MapView. opApply Time complexity: O(n)

    See Also:
    tango.util.collection.MapView. opApply



  • ComparatorT comparator ();
  • Implements tango.util.collection.KeySortedCollection. comparator Time complexity: O(1).

    See Also:
    tango.util.collection.KeySortedCollection. comparator

  • void comparator (ComparatorT c);
  • Use a new Comparator. Causes a reorganization

  • bool containsKey (K key);
  • Implements tango.util.collection.Map. containsKey . Time complexity: O(log n).

    See Also:
    tango.util.collection.Map. containsKey

  • bool containsPair (K key, T element);
  • Implements tango.util.collection.Map. containsPair . Time complexity: O(n).

    See Also:
    tango.util.collection.Map. containsPair

  • PairIterator!(K,T) keys ();
  • Implements tango.util.collection.Map. keys . Time complexity: O(1).

    See Also:
    tango.util.collection.Map. keys

  • T get (K key);
  • Implements tango.util.collection.Map. get . Time complexity: O(log n).

    See Also:
    tango.util.collection.Map. get

  • bool get (K key, ref T value);
  • Return the element associated with Key key. @param key a key

    Returns:
    whether the key is contained or not

  • bool keyOf (ref K key, T value);
  • Implements tango.util.collection.Map. keyOf . Time complexity: O(n).

    See Also:
    tango.util.collection.Map. keyOf

  • void clear ();
  • 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);
  • 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);
  • 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);
  • 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);
  • Implements tango.util.collection.impl.Collection.Collection.replaceAllOf. Time complexity: O(n).

    See Also:
    tango.util.collection.impl.Collection.Collection.replaceAllOf

  • T take ();
  • 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);
  • 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);
  • 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);
  • Implements tango.util.collection.impl.MapCollection.MapCollection.replaceElement. Time complexity: O(log n).

    See Also:
    tango.util.collection.impl.MapCollection.MapCollection.replaceElement

  • void checkImplementation ();
  • Implements tango.util.collection.model.View.View. checkImplementation .

    See Also:
    tango.util.collection.model.View.View. checkImplementation

  • template MapIterator (K,V)
  • opApply() has migrated here to mitigate the virtual call on method get()

    :: page rendered by CandyDoc