|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<T>
org.opensaml.xml.util.ClassIndexedSet<T>
T - the type of object stored by this classpublic class ClassIndexedSet<T>
Set implementation which provides indexed access to set members via their class, and which allows only one instance of a given class to be present in the set. Null members are not allowed.
| Nested Class Summary | |
|---|---|
protected class |
ClassIndexedSet.ClassIndexedSetIterator
Iterator for set implementation ClassIndexedSet. |
| Constructor Summary | |
|---|---|
ClassIndexedSet()
Constructor. |
|
| Method Summary | ||
|---|---|---|
boolean |
add(T o)
|
|
boolean |
add(T o,
boolean replace)
Add member to set, optionally replacing any existing instance of the same class. |
|
void |
clear()
|
|
boolean |
contains(java.lang.Class<? extends T> clazz)
Check whether set contains an instance of the specified class. |
|
|
get(java.lang.Class<X> clazz)
Get the set element specified by the class parameter. |
|
protected java.lang.Class<? extends T> |
getIndexClass(java.lang.Object o)
Get the index class of the specified object. |
|
java.util.Iterator<T> |
iterator()
|
|
boolean |
remove(java.lang.Object o)
|
|
int |
size()
|
|
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, contains, containsAll, isEmpty, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
addAll, contains, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public ClassIndexedSet()
| Method Detail |
|---|
public boolean add(T o)
add in interface java.util.Collection<T>add in interface java.util.Set<T>add in class java.util.AbstractCollection<T>
public boolean add(T o,
boolean replace)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException
o - the object to addreplace - flag indicating whether to replace an existing class type
java.lang.IllegalArgumentException - if set already contained an instance of the object's class
and replacement was specified as false
java.lang.NullPointerException - if the object to add was nullpublic void clear()
clear in interface java.util.Collection<T>clear in interface java.util.Set<T>clear in class java.util.AbstractCollection<T>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<T>remove in interface java.util.Set<T>remove in class java.util.AbstractCollection<T>public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>iterator in interface java.util.Collection<T>iterator in interface java.util.Set<T>iterator in class java.util.AbstractCollection<T>public int size()
size in interface java.util.Collection<T>size in interface java.util.Set<T>size in class java.util.AbstractCollection<T>public boolean contains(java.lang.Class<? extends T> clazz)
clazz - the class to check
public <X extends T> X get(java.lang.Class<X> clazz)
X - generic parameter which eliminates need for casting by the callerclazz - the class to whose instance is to be retrieved
protected java.lang.Class<? extends T> getIndexClass(java.lang.Object o)
o - the object whose class index to determine
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||