Package org.checkerframework.javacutil
Class AnnotationMirrorSet
java.lang.Object
org.checkerframework.javacutil.AnnotationMirrorSet
- All Implemented Interfaces:
- Iterable<AnnotationMirror>,- Collection<AnnotationMirror>,- NavigableSet<@KeyFor("this") AnnotationMirror>,- Set<AnnotationMirror>,- SortedSet<AnnotationMirror>,- org.plumelib.util.DeepCopyable<AnnotationMirrorSet>
public class AnnotationMirrorSet
extends Object
implements NavigableSet<@KeyFor("this") AnnotationMirror>, org.plumelib.util.DeepCopyable<AnnotationMirrorSet>
The Set interface defines many methods with respect to the equals method. This implementation of
 Set violates those specifications, but fulfills the same property using 
AnnotationUtils.areSame(javax.lang.model.element.AnnotationMirror, javax.lang.model.element.AnnotationMirror) rather than equals.
 For example, the specification for the contains(Object o) method says: "returns true if and
 only if this collection contains at least one element e such that (o == null ? e == null :
 o.equals(e))." The specification for contains(java.lang.Object) is "returns true if and
 only if this collection contains at least one element e such that (o == null ? e == null :
 AnnotationUtils.areSame(o, e))".
 
AnnotationMirror is an interface and not all implementing classes provide a correct equals method; therefore, the existing implementations of Set cannot be used.
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor.AnnotationMirrorSet(Collection<? extends AnnotationMirror> annos) Returns a newAnnotationMirrorSetthat contains the given annotation mirrors.Creates a newAnnotationMirrorSetthat containsvalue.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanadd(AnnotationMirror annotationMirror) booleanaddAll(Collection<? extends AnnotationMirror> c) @Nullable @KeyFor("this") AnnotationMirrorvoidclear()Comparator<? super AnnotationMirror>booleanbooleancontainsAll(Collection<?> c) deepCopy()Iterator<@KeyFor("this") AnnotationMirror>static AnnotationMirrorSetemptySet()Returns an empty set.boolean@KeyFor("this") AnnotationMirrorfirst()@Nullable @KeyFor("this") AnnotationMirrorinthashCode()headSet(AnnotationMirror toElement) headSet(AnnotationMirror toElement, boolean inclusive) @Nullable @KeyFor("this") AnnotationMirrorbooleanisEmpty()Iterator<@KeyFor("this") AnnotationMirror>iterator()@KeyFor("this") AnnotationMirrorlast()@Nullable @KeyFor("this") AnnotationMirrorMake this set unmodifiable.@Nullable @KeyFor("this") AnnotationMirror@Nullable @KeyFor("this") AnnotationMirrorpollLast()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) static AnnotationMirrorSetsingleton(AnnotationMirror value) Returns a new unmodifiableAnnotationMirrorSetthat containsvalue.intsize()subSet(AnnotationMirror fromElement, boolean fromInclusive, AnnotationMirror toElement, boolean toInclusive) subSet(AnnotationMirror fromElement, AnnotationMirror toElement) tailSet(AnnotationMirror fromElement) tailSet(AnnotationMirror fromElement, boolean inclusive) Object[]toArray()<@KeyForBottom T>
 @Nullable T[]toString()static AnnotationMirrorSetunmodifiableSet(Collection<? extends AnnotationMirror> annos) Returns an unmodifiable AnnotationMirrorSet with the given elements.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.SortedSetspliterator
- 
Constructor Details- 
AnnotationMirrorSetpublic AnnotationMirrorSet()Default constructor.
- 
AnnotationMirrorSetCreates a newAnnotationMirrorSetthat containsvalue.- Parameters:
- value- the AnnotationMirror to put in the set
 
- 
AnnotationMirrorSetReturns a newAnnotationMirrorSetthat contains the given annotation mirrors.- Parameters:
- annos- the AnnotationMirrors to put in the set
 
 
- 
- 
Method Details- 
deepCopy- Specified by:
- deepCopyin interface- org.plumelib.util.DeepCopyable<AnnotationMirrorSet>
 
- 
makeUnmodifiableMake this set unmodifiable.- Returns:
- this set
 
- 
singletonReturns a new unmodifiableAnnotationMirrorSetthat containsvalue.- Parameters:
- value- the AnnotationMirror to put in the set
- Returns:
- a new unmodifiable AnnotationMirrorSetthat contains onlyvalue
 
- 
unmodifiableSetReturns an unmodifiable AnnotationMirrorSet with the given elements.- Parameters:
- annos- the annotation mirrors that will constitute the new unmodifable set
- Returns:
- an unmodifiable AnnotationMirrorSet with the given elements
 
- 
emptySetReturns an empty set.- Returns:
- an empty set
 
- 
sizepublic int size()- Specified by:
- sizein interface- Collection<AnnotationMirror>
- Specified by:
- sizein interface- Set<AnnotationMirror>
 
- 
isEmptypublic boolean isEmpty()- Specified by:
- isEmptyin interface- Collection<AnnotationMirror>
- Specified by:
- isEmptyin interface- Set<AnnotationMirror>
 
- 
containspublic boolean contains(@UnknownInitialization(AnnotationMirrorSet.class) AnnotationMirrorSet this, @Nullable Object o) - Specified by:
- containsin interface- Collection<AnnotationMirror>
- Specified by:
- containsin interface- Set<AnnotationMirror>
 
- 
iterator- Specified by:
- iteratorin interface- Collection<AnnotationMirror>
- Specified by:
- iteratorin interface- Iterable<AnnotationMirror>
- Specified by:
- iteratorin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
- Specified by:
- iteratorin interface- Set<AnnotationMirror>
 
- 
toArray- Specified by:
- toArrayin interface- Collection<AnnotationMirror>
- Specified by:
- toArrayin interface- Set<AnnotationMirror>
 
- 
toArray- Specified by:
- toArrayin interface- Collection<AnnotationMirror>
- Specified by:
- toArrayin interface- Set<AnnotationMirror>
 
- 
addpublic boolean add(@UnknownInitialization(AnnotationMirrorSet.class) AnnotationMirrorSet this, AnnotationMirror annotationMirror) - Specified by:
- addin interface- Collection<AnnotationMirror>
- Specified by:
- addin interface- Set<AnnotationMirror>
 
- 
remove- Specified by:
- removein interface- Collection<AnnotationMirror>
- Specified by:
- removein interface- Set<AnnotationMirror>
 
- 
containsAll- Specified by:
- containsAllin interface- Collection<AnnotationMirror>
- Specified by:
- containsAllin interface- Set<AnnotationMirror>
 
- 
addAllpublic boolean addAll(@UnknownInitialization(AnnotationMirrorSet.class) AnnotationMirrorSet this, Collection<? extends AnnotationMirror> c) - Specified by:
- addAllin interface- Collection<AnnotationMirror>
- Specified by:
- addAllin interface- Set<AnnotationMirror>
 
- 
retainAll- Specified by:
- retainAllin interface- Collection<AnnotationMirror>
- Specified by:
- retainAllin interface- Set<AnnotationMirror>
 
- 
removeAll- Specified by:
- removeAllin interface- Collection<AnnotationMirror>
- Specified by:
- removeAllin interface- Set<AnnotationMirror>
 
- 
clearpublic void clear()- Specified by:
- clearin interface- Collection<AnnotationMirror>
- Specified by:
- clearin interface- Set<AnnotationMirror>
 
- 
toString
- 
equals- Specified by:
- equalsin interface- Collection<AnnotationMirror>
- Specified by:
- equalsin interface- Set<AnnotationMirror>
- Overrides:
- equalsin class- Object
 
- 
hashCodepublic int hashCode()- Specified by:
- hashCodein interface- Collection<AnnotationMirror>
- Specified by:
- hashCodein interface- Set<AnnotationMirror>
- Overrides:
- hashCodein class- Object
 
- 
comparator- Specified by:
- comparatorin interface- SortedSet<AnnotationMirror>
 
- 
first- Specified by:
- firstin interface- SortedSet<AnnotationMirror>
 
- 
last- Specified by:
- lastin interface- SortedSet<AnnotationMirror>
 
- 
lower- Specified by:
- lowerin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
 
- 
floor- Specified by:
- floorin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
 
- 
ceiling- Specified by:
- ceilingin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
 
- 
higher- Specified by:
- higherin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
 
- 
pollFirst- Specified by:
- pollFirstin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
 
- 
pollLast- Specified by:
- pollLastin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
 
- 
descendingSet- Specified by:
- descendingSetin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
 
- 
descendingIterator- Specified by:
- descendingIteratorin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
 
- 
subSetpublic AnnotationMirrorSet subSet(AnnotationMirror fromElement, boolean fromInclusive, AnnotationMirror toElement, boolean toInclusive) - Specified by:
- subSetin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
 
- 
headSet- Specified by:
- headSetin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
 
- 
tailSet- Specified by:
- tailSetin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
 
- 
subSet- Specified by:
- subSetin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
- Specified by:
- subSetin interface- SortedSet<AnnotationMirror>
 
- 
headSet- Specified by:
- headSetin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
- Specified by:
- headSetin interface- SortedSet<AnnotationMirror>
 
- 
tailSet- Specified by:
- tailSetin interface- NavigableSet<@KeyFor("this") AnnotationMirror>
- Specified by:
- tailSetin interface- SortedSet<AnnotationMirror>
 
 
-