|
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 on| Method 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 Iterableiterator in interface Collectioniterator in interface Setiterator in class AbstractCollectionpublic boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface SetisEmpty in class AbstractCollectionpublic int size()
size in interface Collectionsize in interface Setsize in class AbstractCollectionpublic boolean contains(Object o)
e such that (o==null ? e==null :
o.equals(e)).
contains in interface Collectioncontains in interface Setcontains in class AbstractCollectiono - the object to search for in the set
public boolean containsAll(Collection col)
containsAll in interface CollectioncontainsAll in interface SetcontainsAll in class AbstractCollectioncol - collection to be checked for containment in this collection
public boolean add(Object o)
add in interface Collectionadd in interface Setadd in class AbstractCollectiono - element whose presence in this Collection is to be ensured
public boolean addAll(Collection col)
addAll in interface CollectionaddAll in interface SetaddAll in class AbstractCollectioncol - 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 Collectionremove in interface Setremove in class AbstractCollectiono - element to be removed from this Collection, if present
public boolean removeAll(Collection col)
removeAll in interface CollectionremoveAll in interface SetremoveAll in class AbstractSetcol - elements to be removed from this collection
public boolean retainAll(Collection col)
retainAll in interface CollectionretainAll in interface SetretainAll in class AbstractCollectioncol - elements to be retained in this collection.
public void clear()
clear in interface Collectionclear in interface Setclear in class AbstractCollectionpublic Object[] toArray()
toArray in interface CollectiontoArray in interface SettoArray in class AbstractCollectionpublic 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 CollectiontoArray in interface SettoArray in class AbstractCollectionao - 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 | |||||||