|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractSet blog.AbstractObjectSet
public abstract class AbstractObjectSet
Abstract implementation of the ObjectSet interface. It includes
protected methods isEmptyInternal
, sizeInternal
,
and containsInternal
that return Boolean and Integer objects
rather than primitive data types. Null return values indicate that
the corresponding Set interface method should throw an
IllegalStateException and the corresponding canDetermine
method should return false.
Field Summary |
---|
Fields inherited from interface blog.ObjectSet |
---|
EMPTY_OBJECT_SET, UNDETERMINED_SET |
Constructor Summary | |
---|---|
AbstractObjectSet()
|
Method Summary | |
---|---|
boolean |
canDetermineContains(java.lang.Object obj)
Returns true if the underlying partial world is complete enough to determine whether the given object is in this set. |
boolean |
canDetermineElements()
Returns true if the underlying partial world is complete enough to determine all the elements of this set. |
boolean |
canDetermineIsEmpty()
Returns true if the underlying partial world is complete enough to determine whether this set is empty. |
boolean |
canDetermineSize()
Returns true if the underlying partial world is complete enough to determine the size of this set. |
boolean |
contains(java.lang.Object obj)
|
protected abstract java.lang.Boolean |
containsInternal(java.lang.Object obj)
Returns Boolean.TRUE if this set contains obj ,
Boolean.FALSE if this set does not contain obj , and null
if the underlying partial world is not complete enough to make the
distinction. |
boolean |
isEmpty()
|
protected java.lang.Boolean |
isEmptyInternal()
Returns Boolean.TRUE if this set is empty, Boolean.FALSE if it is not empty, and null if the underlying partial world is not complete enough to determine whether the set is empty. |
java.util.Iterator |
iterator()
Returns the iterator obtained by calling iterator(Collections.EMPTY_SET) : that is, an
iterator that recognizes no externally distinguished objects. |
static ObjectSet |
singleton(java.lang.Object element)
|
int |
size()
|
protected abstract java.lang.Integer |
sizeInternal()
Returns the size of this set, or null if the underlying partial world is not complete enough to determine the size. |
Methods inherited from class java.util.AbstractSet |
---|
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
---|
add, addAll, clear, containsAll, remove, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface blog.ObjectSet |
---|
getExplicitVersion, indexOf, iterator, sample |
Methods inherited from interface java.util.Set |
---|
add, addAll, clear, containsAll, equals, hashCode, remove, removeAll, retainAll, toArray, toArray |
Constructor Detail |
---|
public AbstractObjectSet()
Method Detail |
---|
public boolean isEmpty()
isEmpty
in interface java.util.Collection
isEmpty
in interface java.util.Set
isEmpty
in class java.util.AbstractCollection
public boolean canDetermineIsEmpty()
ObjectSet
canDetermineIsEmpty
in interface ObjectSet
public int size()
size
in interface java.util.Collection
size
in interface java.util.Set
size
in class java.util.AbstractCollection
public boolean canDetermineSize()
ObjectSet
canDetermineSize
in interface ObjectSet
public boolean contains(java.lang.Object obj)
contains
in interface java.util.Collection
contains
in interface java.util.Set
contains
in class java.util.AbstractCollection
public boolean canDetermineContains(java.lang.Object obj)
ObjectSet
canDetermineContains
in interface ObjectSet
public java.util.Iterator iterator()
iterator(Collections.EMPTY_SET)
: that is, an
iterator that recognizes no externally distinguished objects.
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.Set
iterator
in class java.util.AbstractCollection
public boolean canDetermineElements()
ObjectSet
canDetermineElements
in interface ObjectSet
protected java.lang.Boolean isEmptyInternal()
The default implementation just uses the result of sizeInternal.
protected abstract java.lang.Integer sizeInternal()
protected abstract java.lang.Boolean containsInternal(java.lang.Object obj)
obj
,
Boolean.FALSE if this set does not contain obj
, and null
if the underlying partial world is not complete enough to make the
distinction.
public static ObjectSet singleton(java.lang.Object element)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |