tango.util.collection.impl.MapCollection

File:

MapCollection.d

Originally written by Doug Lea and released into the public domain. Thanks for the assistance and support of Sun Microsystems Labs, Agorics Inc, Loral, and everyone contributing, testing, and using this code.

History:

Date Who What 13Oct95 dl Create 28jan97 dl make class public 14Dec06 kb adapted for Tango usage
class MapCollection(K, T) : Collection!(T), Map!(K, T) #
MapCollection extends Collection to provide default implementations of some Map operations.

Author:

Doug Lea @version 0.93

For an introduction to this package see Overview .

this() [protected] #
Initialize at version 0, an empty count, and null screener
this(Predicate screener) [protected] #
Initialize at version 0, an empty count, and supplied screener
bool allowsKey(K key) [public, final] #
Implements tango.util.collection.Map.allowsKey. Default key-screen. Just checks for null.

See Also:

tango.util.collection.Map.allowsKey
void checkKey(K key) [protected, final] #
Principal method to throw a IllegalElementException for keys
void opIndexAssign(T element, K key) [public, final] #
Implements tango.util.collection.impl.MapCollection.MapCollection.opIndexAssign Just calls add(key, element).

See Also:

tango.util.collection.impl.MapCollection.MapCollection.add
bool matches(View!(T) other) [public, override] #
Implements tango.util.collection.impl.Collection.Collection.matches Time complexity: O(n). Default implementation. Fairly sleazy approach. (Defensible only when you remember that it is just a default impl.) It tries to cast to one of the known collection interface types and then applies the corresponding comparison rules. This suffices for all currently supported collection types, but must be overridden if you define new Collection subinterfaces and/or implementations.

See Also:

tango.util.collection.impl.Collection.Collection.matches
void removeAll(Iterator!(T) e) [public] #
Implements tango.util.collection.impl.Collection.Collection.removeAll

See Also:

tango.util.collection.impl.Collection.Collection.removeAll

Has to be here rather than in the superclass to satisfy D interface idioms

void remove(Iterator!(T) e) [public] #
Implements tango.util.collection.impl.Collection.Collection.removeElements

See Also:

tango.util.collection.impl.Collection.Collection.removeElements

Has to be here rather than in the superclass to satisfy D interface idioms