|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.RestrictedCollections.RestrictedCollection
public static class RestrictedCollections.RestrictedCollection
A restricted Collection that requires its contents to be of a specified class.
Field Summary | |
---|---|
protected java.lang.Class |
m_clz The class of Objects stored in the Collection. |
protected java.util.Collection |
m_col The underlying Collection. |
Constructor Summary | |
---|---|
RestrictedCollections.RestrictedCollection(java.util.Collection col, java.lang.Class clz) Constructor. |
Method Summary | |
---|---|
boolean |
add(java.lang.Object o) Ensures that this Collection contains the specified element. |
boolean |
addAll(java.util.Collection col) Adds all of the elements in the specified Collection to this Collection (optional operation). |
protected void |
checkObject(java.lang.Object o) Check the passed object to verify that it passes the restriction of this Collection. |
void |
clear() Removes all of the elements from this Collection. |
boolean |
contains(java.lang.Object o) Returns true if this Collection contains the specified element. |
boolean |
containsAll(java.util.Collection col) Returns true if this Collection contains all of the elements in the specified Collection. |
boolean |
equals(java.lang.Object o) Compares the specified object with this collection for equality. |
int |
hashCode() Returns the hash code value for this collection. |
boolean |
isEmpty() Returns true if this Collection contains no elements. |
java.util.Iterator |
iterator() Returns an Iterator over the elements contained in this Collection. |
boolean |
remove(java.lang.Object o) Removes a single instance of the specified element from this Collection, if it is present (optional operation). |
boolean |
removeAll(java.util.Collection col) Removes all this Collection's elements that are also contained in the specified Collection (optional operation). |
boolean |
retainAll(java.util.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. |
java.lang.Object[] |
toArray() Returns an array containing all of the elements in this Collection. |
java.lang.Object[] |
toArray(java.lang.Object[] ao) Returns an array containing all of the elements in this Collection whose runtime type is that of the specified array. |
java.lang.String |
toString() Return a String description for this collection. |
Field Detail |
---|
protected java.util.Collection m_col
protected java.lang.Class m_clz
Constructor Detail |
---|
public RestrictedCollections.RestrictedCollection(java.util.Collection col, java.lang.Class clz)
col
- the underlying Collectionclz
- the class of objects that may be stored in the CollectionMethod Detail |
---|
public int size()
size
in interface java.util.Collection
public boolean isEmpty()
isEmpty
in interface java.util.Collection
public boolean contains(java.lang.Object o)
e
such that (o==null ? e==null : o.equals(e))
.contains
in interface java.util.Collection
o
- the object to search for in the Collectionpublic java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
public java.lang.Object[] toArray(java.lang.Object[] ao)
toArray
in interface java.util.Collection
ao
- the array into which the elements of this Collection are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purposepublic boolean add(java.lang.Object o)
add
in interface java.util.Collection
o
- element whose presence in this Collection is to be ensuredjava.lang.ClassCastException
- class of the specified element prevents it from being added to this Collectionpublic boolean remove(java.lang.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 java.util.Collection
o
- element to be removed from this Collection, if presentpublic boolean containsAll(java.util.Collection col)
containsAll
in interface java.util.Collection
col
- Collection to be checked for containment in this CollectionCollection.contains(Object)
public boolean addAll(java.util.Collection col)
addAll
in interface java.util.Collection
col
- elements to be inserted into this Collectionjava.lang.ClassCastException
- if the class of an element of the specified Collection prevents it from being added to this CollectionCollection.add(Object)
public boolean removeAll(java.util.Collection col)
removeAll
in interface java.util.Collection
col
- elements to be removed from this CollectionCollection.remove(Object)
, Collection.contains(Object)
public boolean retainAll(java.util.Collection col)
retainAll
in interface java.util.Collection
col
- elements to be retained in this CollectionCollection.remove(Object)
, Collection.contains(Object)
public void clear()
clear
in interface java.util.Collection
public boolean equals(java.lang.Object o)
Obeys the general contract of Collection.equals.
equals
in interface java.util.Collection
o
- Object to be compared for equality with this CollectionObject.equals(Object)
, Set.equals(Object)
, List.equals(Object)
public int hashCode()
hashCode
in interface java.util.Collection
Object.hashCode()
, Object.equals(Object)
public java.lang.String toString()
protected void checkObject(java.lang.Object o)
o
- the Object to checkjava.lang.ClassCastException
- if the class of the passed Object prevents it from being stored in this Collection
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |