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
CtElement
gets 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey(Object key)
entrySet()
boolean
@Nullable T
protected abstract CtElement
getOwner()
protected abstract CtRole
getRole()
int
hashCode()
boolean
isEmpty()
@Nullable T
@Nullable T
void
Updates the mapping for a single key fromoldKey
tonewKey
if present.Methods inherited from class java.util.AbstractMap
clone, containsValue, keySet, putAll, size, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
containsKey
in interfaceMap<String,T extends CtElement>
- Overrides:
containsKey
in classAbstractMap<String,T extends CtElement>
-
get
-
updateKey
Updates the mapping for a single key fromoldKey
tonewKey
if present.- Parameters:
oldKey
- the old keynewKey
- the new key
-
entrySet
-
equals
-
hashCode
public int hashCode()
-