|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractSet
org.geotools.util.Singleton
A mutable set containing only one element. This set can't contains null element.
| Constructor Summary | |
Singleton()
Creates a initially empty singleton. |
|
| Method Summary | |
boolean |
add(java.lang.Object object)
Adds the specified element to this set if it is not already present. |
void |
clear()
Removes the element from this singleton. |
boolean |
contains(java.lang.Object object)
Returns if this singleton contains the specified element. |
java.lang.Object |
get()
Returns the element in this singleton. |
boolean |
isEmpty()
Returns if this singleton contains no elements. |
java.util.Iterator |
iterator()
Returns an iterator over the element of this singleton. |
boolean |
remove(java.lang.Object object)
Removes the specified element from this singleton, if it is present. |
int |
size()
Returns 1 if this singleton contains an element, or 0 otherwise. |
| Methods inherited from class java.util.AbstractSet |
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
addAll, containsAll, 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, containsAll, retainAll, toArray, toArray |
| Constructor Detail |
public Singleton()
| Method Detail |
public int size()
public boolean isEmpty()
public java.lang.Object get()
throws java.util.NoSuchElementException
java.util.NoSuchElementException - if this singleton is empty.public boolean contains(java.lang.Object object)
public boolean add(java.lang.Object object)
java.lang.NullPointerException - if the argument is null.
java.lang.IllegalArgumentException - if this set already contains an other element.public boolean remove(java.lang.Object object)
public void clear()
public java.util.Iterator iterator()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||