|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
java.util.AbstractCollection
java.util.AbstractSet
com.tangosol.util.LiteSet
public class LiteSet
An implementation of java.util.Set that is optimal (in terms of both size and speed) for very small sets of data but still works excellently with large sets of data. This implementation is not thread-safe.
The LiteSet implementation switches at runtime between several different sub-implementations for storing the set of objects, described here:
instantiateSet().The LiteSet implementation supports the null value.
| Constructor Summary | |
|---|---|
LiteSet()Construct a LiteSet |
|
LiteSet(java.util.Collection collection)Construct a LiteSet containing the elements of the passed Collection. |
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object o)Ensures that this Set contains the specified element. |
boolean |
addAll(java.util.Collection collection)Adds all of the elements in the specified Collection to this Set if they are not already present. |
protected void |
checkShrinkFromOther()After a mutation operation has reduced the size of an underlying Set, check if the delegation model should be replaced with a more size- efficient storage approach, and switch accordingly. |
void |
clear()Removes all of the elements from this Set. |
java.lang.Object |
clone()Create a clone of this Set. |
boolean |
contains(java.lang.Object o)Returns true if this Set contains the specified element. |
boolean |
containsAll(java.util.Collection collection)Returns true if this Set contains all of the elements in the specified Collection. |
java.util.Enumeration |
elements()Returns an Enumerator over the elements in this Set. |
protected void |
initFromArray(java.lang.Object[] ao, int c)Initialize the contents of this Set from the passed array ao containing c values. |
protected java.util.Set |
instantiateSet()(Factory pattern) Instantiate a Set object to store items in once the "lite" threshold has been exceeded. |
boolean |
isEmpty()Determine if this Set is empty. |
java.util.Iterator |
iterator()Returns an Iterator over the elements in this Set. |
void |
readExternal(java.io.DataInput in)Restore the contents of this object by loading the object's state from the passed DataInput object. |
void |
readExternal(java.io.ObjectInput in)Initialize this object from the data in the passed ObjectInput stream. |
boolean |
remove(java.lang.Object o)Removes the specified element from this Set if it is present. |
boolean |
removeAll(java.util.Collection collection)Removes from this Set all of its elements that are contained in the specified Collection. |
boolean |
retainAll(java.util.Collection collection)Retains only the elements in this Set that are contained in the specified Collection. |
int |
size()Returns the number of elements in this Set (its cardinality). |
java.lang.Object[] |
toArray()Returns an array containing all of the elements in this Set. |
java.lang.Object[] |
toArray(java.lang.Object[] aDest)Returns an array (whose runtime type is that of the specified array) containing all of the elements in this Set. |
void |
writeExternal(java.io.DataOutput out)Save the contents of this object by storing the object's state into the passed DataOutput object. |
void |
writeExternal(java.io.ObjectOutput out)Write this object's data to the passed ObjectOutput stream. |
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode |
| Methods inherited from class java.util.AbstractCollection |
|---|
toString |
| Constructor Detail |
|---|
public LiteSet()
public LiteSet(java.util.Collection collection)
collection - a Collection| Method Detail |
|---|
public boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.SetisEmpty in class java.util.AbstractCollectionpublic int size()
size in interface java.util.Collectionsize in interface java.util.Setsize in class java.util.AbstractCollectionpublic boolean contains(java.lang.Object o)
e such that (o==null ? e==null : o.equals(e)).contains in interface java.util.Collectioncontains in interface java.util.Setcontains in class java.util.AbstractCollectiono - the object to check forpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setiterator in class java.util.AbstractCollectionpublic java.util.Enumeration elements()
public java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.SettoArray in class java.util.AbstractCollectionpublic java.lang.Object[] toArray(java.lang.Object[] aDest)
toArray in interface java.util.CollectiontoArray in interface java.util.SettoArray in class java.util.AbstractCollectionaDest - 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 purposejava.lang.ArrayStoreException - if the component type of aDest is not a supertype of the type of every element in this Setpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Setadd in class java.util.AbstractCollectiono - element to be added to this Setpublic boolean remove(java.lang.Object o)
e such that (o==null ? e==null : o.equals(e)), if the Set contains such an element. Returns true if the Set contained the specified element (or equivalently, if the Set changed as a result of the call). The Set will not contain the specified element once the call returns.remove in interface java.util.Collectionremove in interface java.util.Setremove in class java.util.AbstractCollectiono - object to be removed from this Set, if presentpublic boolean containsAll(java.util.Collection collection)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.SetcontainsAll in class java.util.AbstractCollectioncollection - Collection to be checked for containment in this Setpublic boolean addAll(java.util.Collection collection)
addAll in interface java.util.CollectionaddAll in interface java.util.SetaddAll in class java.util.AbstractCollectioncollection - Collection whose elements are to be added to this Setpublic boolean retainAll(java.util.Collection collection)
retainAll in interface java.util.CollectionretainAll in interface java.util.SetretainAll in class java.util.AbstractCollectioncollection - collection that defines which elements this Set will retainpublic boolean removeAll(java.util.Collection collection)
removeAll in interface java.util.CollectionremoveAll in interface java.util.SetremoveAll in class java.util.AbstractSetcollection - Collection that defines which elements will be removed from this Setpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Setclear in class java.util.AbstractCollectionpublic java.lang.Object clone()
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablein - the stream to read data from in order to restore the objectjava.io.IOException - if an I/O exception occursjava.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizableout - the stream to write the object tojava.io.IOException - if an I/O exception occurs
public void readExternal(java.io.DataInput in)
throws java.io.IOException
readExternal in interface ExternalizableLitein - the DataInput stream to read data from in order to restore the state of this objectjava.io.IOException - if an I/O exception occursjava.io.NotActiveException - if the object is not in its initial state, and therefore cannot be deserialized into
public void writeExternal(java.io.DataOutput out)
throws java.io.IOException
writeExternal in interface ExternalizableLiteout - the DataOutput stream to write the state of this object tojava.io.IOException - if an I/O exception occursprotected java.util.Set instantiateSet()
protected void initFromArray(java.lang.Object[] ao,
int c)
ao - the array that contains the values to place in this Setc - the number of values that will be placed into this Setprotected void checkShrinkFromOther()
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||