|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractSet
|
+--org.jutil.java.collections.Singleton
| Inner Class Summary | |
class |
Singleton.SingletonIterator
|
| Field Summary | |
static java.lang.String |
CVS_REVISION
|
| Constructor Summary | |
Singleton(java.lang.Object onlyElement)
public behavior post getOnlyElement() == onlyElement; Initialize a new Singleton containing the given element. |
|
| Method Summary | |
boolean |
add(java.lang.Object o)
also public behavior post false; exception UnsupportedOperationException true; See superclass |
boolean |
addAll(java.util.Collection c)
also public behavior post false; exception UnsupportedOperationException true; See superclass |
void |
clear()
also public behavior post false; exception UnsupportedOperationException true; See superclass |
boolean |
contains(java.lang.Object o)
also public behavior post \result == ((getOnlyElement() == null) && (o == null)) || getOnlyElement().equals(o); See superclass |
java.lang.Object |
getOnlyElement()
Return the only element in this Singleton. |
boolean |
isEmpty()
also public behavior post \result == false; See superclass |
java.util.Iterator |
iterator()
also public behavior post \result instanceof SingletonIterator; post \result != null; See superclass |
boolean |
remove(java.lang.Object o)
also public behavior post false; exception UnsupportedOperationException true; See superclass |
boolean |
removeAll(java.util.Collection c)
also public behavior post false; exception UnsupportedOperationException true; See superclass |
boolean |
retainAll(java.util.Collection c)
also public behavior post false; exception UnsupportedOperationException true; See superclass |
int |
size()
also public behavior post \result == 1; See superclass |
java.lang.Object[] |
toArray()
also public behavior post \result.length = 1; post \result[0] == getOnlyElement(); See superclass |
java.lang.Object[] |
toArray(java.lang.Object[] a)
also public behavior post \result.getClass().getComponentType() == a.getClass().getComponentType(); post \result[0] == getOnlyElement(); post (a.length >= 1) ==> (\result == a); post (a.length < 1) ==> (\result.length == 1); exception NullPointerException a == null; exception ArrayStoreException (getOnlyElement() != null) && (! a.getClass().isInstance(getOnlyElement())); See superclass |
| Methods inherited from class java.util.AbstractSet |
equals, hashCode |
| Methods inherited from class java.util.AbstractCollection |
containsAll, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
containsAll |
| Field Detail |
public static final java.lang.String CVS_REVISION
| Constructor Detail |
public Singleton(java.lang.Object onlyElement)
onlyElement - The only element of this Singleton.| Method Detail |
public java.lang.Object getOnlyElement()
public int size()
size in class java.util.AbstractCollectionpublic boolean isEmpty()
isEmpty in class java.util.AbstractCollectionpublic boolean contains(java.lang.Object o)
contains in class java.util.AbstractCollectionpublic java.util.Iterator iterator()
iterator in class java.util.AbstractCollectionpublic java.lang.Object[] toArray()
toArray in class java.util.AbstractCollectionpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in class java.util.AbstractCollection
public boolean add(java.lang.Object o)
throws java.lang.UnsupportedOperationException
add in class java.util.AbstractCollection
public boolean remove(java.lang.Object o)
throws java.lang.UnsupportedOperationException
remove in class java.util.AbstractCollection
public boolean addAll(java.util.Collection c)
throws java.lang.UnsupportedOperationException
addAll in class java.util.AbstractCollection
public boolean retainAll(java.util.Collection c)
throws java.lang.UnsupportedOperationException
retainAll in class java.util.AbstractCollection
public boolean removeAll(java.util.Collection c)
throws java.lang.UnsupportedOperationException
removeAll in class java.util.AbstractSet
public void clear()
throws java.lang.UnsupportedOperationException
clear in class java.util.AbstractCollection
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||