Class AnnotationMirrorMap<V>
java.lang.Object
org.checkerframework.framework.util.AnnotationMirrorMap<V>
- All Implemented Interfaces:
Map<AnnotationMirror,V>
The Map interface defines some of its methods with respect to the equals method. This
implementation of Map violates those specifications, but fulfills the same property using
AnnotationUtils.areSame(javax.lang.model.element.AnnotationMirror, javax.lang.model.element.AnnotationMirror).
For example, the specification for the containsKey(Object key) method says: "returns true if
and only if this map contains a mapping for a key k such that (key == null ? k == null :
key.equals(k))." The specification for containsKey(java.lang.Object) is "returns true
if and only if this map contains a mapping for a key k such that (key == null ? k == null :
AnnotationUtils.areSame(key, k))."
AnnotationMirror is an interface and not all implementing classes provide a correct equals method; therefore, existing implementations of Map cannot be used.
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.AnnotationMirrorMap(Map<AnnotationMirror, ? extends V> copy) Creates an annotation mirror map and adds all the mappings incopy. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanisEmpty()keySet()put(AnnotationMirror key, V value) voidputAll(Map<? extends AnnotationMirror, ? extends V> m) intsize()toString()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
AnnotationMirrorMap
public AnnotationMirrorMap()Default constructor. -
AnnotationMirrorMap
Creates an annotation mirror map and adds all the mappings incopy.- Parameters:
copy- a map whose contents should be copied to the newly created map
-
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceMap<AnnotationMirror,V>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceMap<AnnotationMirror,V>
-
containsKey
- Specified by:
containsKeyin interfaceMap<AnnotationMirror,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<AnnotationMirror,V>
-
get
- Specified by:
getin interfaceMap<AnnotationMirror,V>
-
put
- Specified by:
putin interfaceMap<AnnotationMirror,V>
-
remove
- Specified by:
removein interfaceMap<AnnotationMirror,V>
-
putAll
- Specified by:
putAllin interfaceMap<AnnotationMirror,V>
-
clear
public void clear()- Specified by:
clearin interfaceMap<AnnotationMirror,V>
-
keySet
- Specified by:
keySetin interfaceMap<AnnotationMirror,V>
-
values
- Specified by:
valuesin interfaceMap<AnnotationMirror,V>
-
entrySet
- Specified by:
entrySetin interfaceMap<AnnotationMirror,V>
-
toString
-