Module io.leangen.geantyref
Package io.leangen.geantyref
Class AnnotatedTypeSet<E extends java.lang.reflect.AnnotatedType>
- java.lang.Object
-
- io.leangen.geantyref.AnnotatedTypeSet<E>
-
- Type Parameters:
E- the type of the elements maintained by this set
- All Implemented Interfaces:
java.lang.Iterable<E>,java.util.Collection<E>,java.util.Set<E>
public class AnnotatedTypeSet<E extends java.lang.reflect.AnnotatedType> extends java.lang.Object implements java.util.Set<E>ASetimplementation suited for maintainingAnnotatedTypeelements. The standard sets do not usually suffice asAnnotatedTypeimplements neitherequalsnorhashCode. This implementation overcomes that limitation by transparently turning eachAnnotatedTypeinto the canonical form usingGenericTypeReflector.toCanonical(AnnotatedType). By default,AnnotatedTypeSetinstances are backed by aHashSet, but any set can be used instead. The guarantees ofAnnotatedTypeSetare then the same as of the set it is backed by.- See Also:
AnnotatedTypeMap
-
-
Constructor Summary
Constructors Constructor Description AnnotatedTypeSet()AnnotatedTypeSet(java.util.Set<E> inner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)booleanaddAll(java.util.Collection<? extends E> c)private java.util.Collection<?>canonical(java.util.Collection<?> c)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)booleanisEmpty()java.util.Iterator<E>iterator()booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)intsize()java.lang.Object[]toArray()<T> T[]toArray(T[] a)
-
-
-
Field Detail
-
inner
private final java.util.Set<E extends java.lang.reflect.AnnotatedType> inner
-
-
Constructor Detail
-
AnnotatedTypeSet
public AnnotatedTypeSet()
-
AnnotatedTypeSet
public AnnotatedTypeSet(java.util.Set<E> inner)
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(java.lang.Object o)
-
iterator
public java.util.Iterator<E> iterator()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(E e)
-
remove
public boolean remove(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
clear
public void clear()
-
canonical
private java.util.Collection<?> canonical(java.util.Collection<?> c)
-
-