Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities
Class AnyMap<K>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,Object>
          extended by de.lmu.ifi.dbs.elki.utilities.AnyMap<K>
Type Parameters:
K - Key class type
All Implemented Interfaces:
Serializable, Cloneable, Map<K,Object>

public class AnyMap<K>
extends HashMap<K,Object>

Associative storage based on a HashMap for multiple object types that offers a type checked get(Object, Class) method. The use of the inherited get(Object) method is depreciated.

Author:
Erich Schubert
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
private static long serialVersionUID
          Serial version.
 
Constructor Summary
AnyMap()
          Constructor
 
Method Summary
<T> T
get(K key, Class<T> restriction)
          Type checked get method
 Object get(Object key)
          Deprecated. 
<T> T
getGenerics(K key, Class<?> restriction)
          (Largely) type checked get method for use with generic types
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial version.

See Also:
Constant Field Values
Constructor Detail

AnyMap

public AnyMap()
Constructor

Method Detail

get

public <T> T get(K key,
                 Class<T> restriction)
Type checked get method

Type Parameters:
T - Return type
Parameters:
key - Key
restriction - restriction class
Returns:
Object that is guaranteed to be of class restriction or null

getGenerics

public <T> T getGenerics(K key,
                         Class<?> restriction)
(Largely) type checked get method for use with generic types

Type Parameters:
T - Return type
Parameters:
key - Key
restriction - restriction class
Returns:
Object that is guaranteed to be of class restriction or null

get

@Deprecated
public Object get(Object key)
Deprecated. 

Depreciate the use of the untyped get method.

Specified by:
get in interface Map<K,Object>
Overrides:
get in class HashMap<K,Object>

Release 0.2 (2009-07-06_1820)