|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.collection.base.AbstractClassHierarchieMap<E>
net.sf.mmm.util.collection.base.AdvancedClassHierarchieMap<E>
E - is the generic type of the elements contained in this map.public abstract class AdvancedClassHierarchieMap<E>
This class extends AbstractClassHierarchieMap with the ability to
replace elements (<E>) on recursive
puts if the new element has a
more general type.
Therefore an according sub-class has to implement the abstract method
getClass(Object).
| Constructor Summary | |
|---|---|
AdvancedClassHierarchieMap()
The constructor. |
|
AdvancedClassHierarchieMap(MapFactory<Map> mapFactory)
The constructor. |
|
| Method Summary | |
|---|---|
protected abstract Class<?> |
getClass(E element)
This method gets the associated type for the given
element. |
protected boolean |
isPreferable(E element,
Class<?> elementType,
E existing,
Class<?> currentType)
This method determines if the given element should be
associated with currentType in preference
to the element existing that is already registered and will be
replaced according to the result of this method. |
protected E |
put(E element)
This method puts the given element
using its associated class. |
| Methods inherited from class net.sf.mmm.util.collection.base.AbstractClassHierarchieMap |
|---|
get, isAccepted, put |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AdvancedClassHierarchieMap()
public AdvancedClassHierarchieMap(MapFactory<Map> mapFactory)
mapFactory - is the factory used to create the internal Map.| Method Detail |
|---|
protected abstract Class<?> getClass(E element)
type for the given
element.
element - is the element for which the type is
requested.
Class of the given element.protected E put(E element)
puts the given element
using its associated class.
element - is the element to put.
null if none has
been replaced.
protected boolean isPreferable(E element,
Class<?> elementType,
E existing,
Class<?> currentType)
element should be
associated with currentType in preference
to the element existing that is already registered and will be
replaced according to the result of this method.
isPreferable in class AbstractClassHierarchieMap<E>element - is the element to register.elementType - is the type for which the given element is
to be registered originally.existing - is the element that has already been registered before and
is associated with currentType.currentType - is the registration type.
true if the given element is preferable
and should replace existing for
currentType, false otherwise (if
existing should remain associated
with currentType).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||