javautils.maps
Class AbstractTypedMap

java.lang.Object
  |
  +--javautils.maps.AbstractTypedMap
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
ObjectToBooleanMap, ObjectToByteMap, ObjectToCharMap, ObjectToDoubleMap, ObjectToFloatMap, ObjectToIntMap, ObjectToListMap, ObjectToLongMap, ObjectToShortMap

public abstract class AbstractTypedMap
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Abstract base for typed maps.

See Also:
Serialized Form

Field Summary
protected  java.util.Map map
           
 
Constructor Summary
AbstractTypedMap()
          A new map based on HashMap.
AbstractTypedMap(java.util.Map map)
          A new map based on the given map.
 
Method Summary
 void clear()
          Removes all mappings from this map.
 java.lang.Object clone()
          A new deepish clone of the map (values are cloned, but keys, which should never be modified anyway, aren't).
 boolean containsKey(java.lang.Object key)
          True if and only if the key is associated with a value.
 boolean isEmpty()
          True iff the size of this map is 0.
 java.util.Iterator keyIterator()
          An iterator over all keys of this map.
 java.util.Set keySet()
          A mutable set of keys of this map.
 void remove(java.lang.Object key)
          Removes the specified key from this map.
 int size()
          The size of this map.
 java.lang.String toString()
          A textual representation of this map.
 java.util.Map unmodifiableMap()
          An unmodifiable view to the internal map.
 java.util.Iterator valueIterator()
          An iterator over all values of this map.
protected abstract  boolean valuePredicate(java.lang.Object value)
          True iff the value satisfies the typing constraints.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

map

protected final java.util.Map map
Constructor Detail

AbstractTypedMap

public AbstractTypedMap()

A new map based on HashMap.


AbstractTypedMap

public AbstractTypedMap(java.util.Map map)

A new map based on the given map.

Method Detail

clear

public void clear()

Removes all mappings from this map.


clone

public java.lang.Object clone()

A new deepish clone of the map (values are cloned, but keys, which should never be modified anyway, aren't).

Overrides:
clone in class java.lang.Object

containsKey

public boolean containsKey(java.lang.Object key)

True if and only if the key is associated with a value.


isEmpty

public boolean isEmpty()

True iff the size of this map is 0.


keyIterator

public java.util.Iterator keyIterator()

An iterator over all keys of this map.


keySet

public java.util.Set keySet()

A mutable set of keys of this map.


remove

public void remove(java.lang.Object key)

Removes the specified key from this map.


size

public int size()

The size of this map.


toString

public java.lang.String toString()

A textual representation of this map.

Overrides:
toString in class java.lang.Object

unmodifiableMap

public java.util.Map unmodifiableMap()

An unmodifiable view to the internal map.


valueIterator

public java.util.Iterator valueIterator()

An iterator over all values of this map.


valuePredicate

protected abstract boolean valuePredicate(java.lang.Object value)

True iff the value satisfies the typing constraints.