|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractSet
com.tangosol.util.SubSet
public class SubSet
Implements a set which is based on another set, which is assumed to be immutable. Unlike DeltaSet, the SubSet is assumed to be a subset of the underlying set, and optimizes for both remove and retain operations.
Nested Class Summary | |
---|---|
protected class |
SubSet.SubSetIterator
Iterator for the contents of a subset. |
Constructor Summary | |
---|---|
SubSet(Set set)
Construct this set based on an existing set. |
Method Summary | |
---|---|
boolean |
add(Object o)
Ensures that this Collection contains the specified element. |
boolean |
addAll(Collection col)
Adds all of the elements in the specified collection to this collection. |
void |
clear()
Removes all of the elements from this Collection. |
Object |
clone()
Clone the subset. |
boolean |
contains(Object o)
Returns true if this Collection contains the specified element. |
boolean |
containsAll(Collection col)
Returns true if this collection contains all of the elements in the specified collection. |
protected Set |
ensureRemoved()
Get a mutable set of items that are removed in the subset. |
protected Set |
ensureRetained()
Get a mutable set of items that are retained in the subset. |
Set |
getOriginal()
Determine what items were in the original set. |
Set |
getRemoved()
Determine what items were removed from the subset. |
Set |
getRetained()
Determine what items were added to the subset. |
boolean |
isEmpty()
Determine if the SubSet is empty. |
boolean |
isModified()
Determine if the set has been modified. |
boolean |
isTrackingRemoved()
Determine if the SubSet is tracking removed items versus retained items. |
boolean |
isTrackingRetained()
Determine if the SubSet is tracking retained items versus removed items. |
Iterator |
iterator()
Returns an Iterator over the elements contained in this Collection. |
boolean |
remove(Object o)
Removes a single instance of the specified element from this Collection, if it is present (optional operation). |
boolean |
removeAll(Collection col)
Removes all this collection's elements that are also contained in the specified collection (optional operation). |
void |
reset()
Discard the changes to the set ("rollback"). |
void |
resolve()
Apply the changes to the underlying set ("commit"). |
boolean |
retainAll(Collection col)
Retains only the elements in this collection that are contained in the specified collection (optional operation). |
int |
size()
Returns the number of elements in this Collection. |
Object[] |
toArray()
Returns an array containing all of the elements in this Set. |
Object[] |
toArray(Object[] ao)
Returns an array with a runtime type is that of the specified array and that contains all of the elements in this collection. |
Methods inherited from class java.util.AbstractSet |
---|
equals, hashCode |
Methods inherited from class java.util.AbstractCollection |
---|
toString |
Constructor Detail |
---|
public SubSet(Set set)
set
- the set to base this subset onMethod Detail |
---|
public Set getOriginal()
public boolean isModified()
public boolean isTrackingRetained()
public Set getRetained()
public boolean isTrackingRemoved()
public Set getRemoved()
protected Set ensureRetained()
protected Set ensureRemoved()
public void resolve()
public void reset()
public Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
iterator
in interface Set
iterator
in class AbstractCollection
public boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface Set
isEmpty
in class AbstractCollection
public int size()
size
in interface Collection
size
in interface Set
size
in class AbstractCollection
public boolean contains(Object o)
e
such that (o==null ? e==null :
o.equals(e))
.
contains
in interface Collection
contains
in interface Set
contains
in class AbstractCollection
o
- the object to search for in the set
public boolean containsAll(Collection col)
containsAll
in interface Collection
containsAll
in interface Set
containsAll
in class AbstractCollection
col
- collection to be checked for containment in this collection
public boolean add(Object o)
add
in interface Collection
add
in interface Set
add
in class AbstractCollection
o
- element whose presence in this Collection is to be ensured
public boolean addAll(Collection col)
addAll
in interface Collection
addAll
in interface Set
addAll
in class AbstractCollection
col
- collection of elements to be inserted into this collection
public boolean remove(Object o)
e
such that (o==null ? e==null :
o.equals(e))
, if the Collection contains one or more such
elements. Returns true if the Collection contained the specified
element (or equivalently, if the Collection changed as a result of the
call).
remove
in interface Collection
remove
in interface Set
remove
in class AbstractCollection
o
- element to be removed from this Collection, if present
public boolean removeAll(Collection col)
removeAll
in interface Collection
removeAll
in interface Set
removeAll
in class AbstractSet
col
- elements to be removed from this collection
public boolean retainAll(Collection col)
retainAll
in interface Collection
retainAll
in interface Set
retainAll
in class AbstractCollection
col
- elements to be retained in this collection.
public void clear()
clear
in interface Collection
clear
in interface Set
clear
in class AbstractCollection
public Object[] toArray()
toArray
in interface Collection
toArray
in interface Set
toArray
in class AbstractCollection
public Object[] toArray(Object[] ao)
If the collection fits in the specified array with room to spare (i.e., the array has more elements than the collection), the element in the array immediately following the end of the collection is set to null. This is useful in determining the length of the collection only if the caller knows that the collection does not contain any null elements.)
toArray
in interface Collection
toArray
in interface Set
toArray
in class AbstractCollection
ao
- the array into which the elements of the collection are to
be stored, if it is big enough; otherwise, a new array of
the same runtime type is allocated for this purpose
ArrayStoreException
- if the runtime type of the specified array
is not a supertype of the runtime type of every element in this
collectionpublic Object clone()
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |