net.sf.mmm.util.collection.base
Class SimpleClassHierarchieMap<E>

java.lang.Object
  extended by net.sf.mmm.util.collection.base.AbstractClassHierarchieMap<E>
      extended by net.sf.mmm.util.collection.base.SimpleClassHierarchieMap<E>
Type Parameters:
E - is the generic type of the elements contained in this map.

public class SimpleClassHierarchieMap<E>
extends AbstractClassHierarchieMap<E>

This is a simple implementation of AbstractClassHierarchieMap.

Since:
1.0.1
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Constructor Summary
SimpleClassHierarchieMap()
          The constructor.
SimpleClassHierarchieMap(MapFactory<Map> mapFactory)
          The constructor.
 
Method Summary
 E put(Class<?> type, E element)
          This method registers the given element for the given type.
 
Methods inherited from class net.sf.mmm.util.collection.base.AbstractClassHierarchieMap
get, isAccepted, isPreferable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleClassHierarchieMap

public SimpleClassHierarchieMap()
The constructor.


SimpleClassHierarchieMap

public SimpleClassHierarchieMap(MapFactory<Map> mapFactory)
The constructor.

Parameters:
mapFactory - is the factory used to create the internal Map.
Method Detail

put

public E put(Class<?> type,
             E element)
This method registers the given element for the given type. Unlike a regular Map this method will also recursively put the given element for all super-classes and super-interfaces of the given type.

Overrides:
put in class AbstractClassHierarchieMap<E>
Parameters:
type - is the Class used as key to associate the given element.
element - is the element to put.
Returns:
the element that was associated directly with the given type and has NOW been replaced with element.
See Also:
Map.put(Object, Object)


Copyright © 2001-2010 mmm-Team. All Rights Reserved.