|
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.MapSet
public class MapSet
An ExternalizableLite implementation of java.util.Set that uses an underlying Map object to store its data in, just as the Java HashSet implementation uses an underlying HashMap for its element storage.
| Field Summary | |
|---|---|
protected Map |
m_map
The underlying Map. |
protected static Object |
NO_VALUE
A no-value object. |
| Constructor Summary | |
|---|---|
MapSet()
Default constructor. |
|
MapSet(Map map)
Construct a Map from the |
|
| Method Summary | |
|---|---|
boolean |
add(Object o)
Ensures that this Set contains the specified element. |
boolean |
addAll(Collection coll)
Adds all of the elements in the specified Collection to this Set if they're not already present. |
void |
clear()
Removes all of the elements from this Set. |
Object |
clone()
Create a clone of this MapSet. |
boolean |
contains(Object o)
Returns true if this Set contains the specified element. |
boolean |
containsAll(Collection coll)
Returns true if this Set contains all of the elements in the specified Collection. |
Map |
getMap()
Obtain the underlying Map for purposes of synchronization or read-only access; the caller must never directly modify the returned Map. |
protected Map |
instantiateMap()
Factory pattern: Provide an underlying Map for this Set implementation to store its contents in. |
Iterator |
iterator()
Returns an iterator over the elements in this Set. |
void |
readExternal(DataInput in)
Restore the contents of this object by loading the object's state from the passed DataInput object. |
void |
readExternal(ObjectInput in)
Initialize this object from the contents of the passed object stream. |
boolean |
remove(Object o)
Removes the specified element from this Set if it is present. |
boolean |
removeAll(Collection coll)
Removes from this Set all of its elements that are contained in the specified Collection. |
boolean |
retainAll(Collection coll)
Retains only the elements in this Set that are contained in the specified Collection. |
int |
size()
Returns the number of elements in this Set. |
Object[] |
toArray()
Returns an array containing all of the elements in this Set. |
Object[] |
toArray(Object[] ao)
Returns an array containing all of the elements in this set whose runtime type is that of the specified array. |
void |
writeExternal(DataOutput out)
Save the contents of this object by storing the object's state into the passed DataOutput object. |
void |
writeExternal(ObjectOutput out)
Write the contents of this object into the passed object stream. |
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode |
| Methods inherited from class java.util.AbstractCollection |
|---|
isEmpty, toString |
| Methods inherited from interface java.util.Set |
|---|
isEmpty |
| Field Detail |
|---|
protected static final Object NO_VALUE
protected transient Map m_map
| Constructor Detail |
|---|
public MapSet()
MapSet(Map) constructor.
To change the default Map implementation, sub-class the MapSet
and override the instantiateMap() method.
public MapSet(Map map)
| Method Detail |
|---|
public int size()
size in interface Collectionsize in interface Setsize in class AbstractCollectionpublic boolean contains(Object o)
contains in interface Collectioncontains in interface Setcontains in class AbstractCollectionpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Setiterator in class AbstractCollectionpublic Object[] toArray()
Collection.toArray()
method.
toArray in interface CollectiontoArray in interface SettoArray in class AbstractCollectionpublic Object[] toArray(Object[] ao)
Collection.toArray(Object[]) method.
toArray in interface CollectiontoArray in interface SettoArray in class AbstractCollectionao - the array into which the elements of this Set are to
be stored, if it is big enough; otherwise, a new array of the
same runtime type is allocated for this purpose
ArrayStoreException - the runtime type of a is not a supertype
of the runtime type of every element in this Setpublic boolean add(Object o)
add in interface Collectionadd in interface Setadd in class AbstractCollectiono - element to be added to this Set
public boolean remove(Object o)
remove in interface Collectionremove in interface Setremove in class AbstractCollectiono - object to be removed from this Set, if present
public boolean containsAll(Collection coll)
containsAll in interface CollectioncontainsAll in interface SetcontainsAll in class AbstractCollectioncoll - Collection to be checked for containment in this Set
contains(Object)public boolean addAll(Collection coll)
addAll in interface CollectionaddAll in interface SetaddAll in class AbstractCollectioncoll - Collection whose elements are to be added to this Set
add(Object)public boolean retainAll(Collection coll)
retainAll in interface CollectionretainAll in interface SetretainAll in class AbstractCollectioncoll - Collection that defines which elements this Set will retain
public boolean removeAll(Collection coll)
removeAll in interface CollectionremoveAll in interface SetremoveAll in class AbstractSetcoll - Collection that defines which elements will be removed
from this Set
remove(Object)public void clear()
clear in interface Collectionclear in interface Setclear in class AbstractCollectionpublic Map getMap()
public Object clone()
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface Externalizablein - the stream to read data from in order to restore the object
IOException - if an I/O exception occurs
ClassNotFoundException
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface Externalizableout - the stream to write the object to
IOException - if an I/O exception occurs
public void readExternal(DataInput in)
throws IOException
readExternal in interface ExternalizableLitein - the DataInput stream to read data from in order to restore
the state of this object
IOException - if an I/O exception occurs
NotActiveException - if the object is not in its initial
state, and therefore cannot be deserialized into
public void writeExternal(DataOutput out)
throws IOException
writeExternal in interface ExternalizableLiteout - the DataOutput stream to write the state of this object to
IOException - if an I/O exception occursprotected Map instantiateMap()
|
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 | |||||||