Package spoon.support.util.internal
Class ElementNameMap<T extends CtElement>
- All Implemented Interfaces:
Serializable,Map<String,T>
public abstract class ElementNameMap<T extends CtElement>
extends AbstractMap<String,T>
implements Serializable
This class is for internal use only.
An implementation of a Map currently used by packages to manage contained types and
sub-packages.
>
This map is currently specialized to string keys to simplify the types a bit. Nothing
fundamentally requires Strings, and it might be changed in the future.
It assures:
- each inserted
CtElementgets assigned correct parent - each change is reported in
FineModelChangeListener - The
entrySet()method returns elements in the order they were inserted
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key)entrySet()boolean@Nullable Tprotected abstract CtElementgetOwner()protected abstract CtRolegetRole()inthashCode()booleanisEmpty()@Nullable T@Nullable TvoidUpdates the mapping for a single key fromoldKeytonewKeyif present.Methods inherited from class java.util.AbstractMap
clone, containsValue, keySet, putAll, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
ElementNameMap
protected ElementNameMap()
-
-
Method Details
-
getOwner
-
getRole
-
put
-
remove
-
isEmpty
public boolean isEmpty() -
clear
public void clear() -
containsKey
- Specified by:
containsKeyin interfaceMap<String,T extends CtElement>- Overrides:
containsKeyin classAbstractMap<String,T extends CtElement>
-
get
-
updateKey
Updates the mapping for a single key fromoldKeytonewKeyif present.- Parameters:
oldKey- the old keynewKey- the new key
-
entrySet
-
equals
-
hashCode
public int hashCode()
-