javawebparts.core
Class CaseInsensitiveMap.AbstractCollectionView

java.lang.Object
  |
  +--javawebparts.core.CaseInsensitiveMap.AbstractCollectionView
All Implemented Interfaces:
java.util.Collection
Direct Known Subclasses:
CaseInsensitiveMap.EntrySet, CaseInsensitiveMap.KeySet, CaseInsensitiveMap.ValuesCollection
Enclosing class:
CaseInsensitiveMap

private abstract class CaseInsensitiveMap.AbstractCollectionView
extends java.lang.Object
implements java.util.Collection

Abstract implementation having all the common functionality used by the collection view classes returned by keySet(), entrySet() and values().


Constructor Summary
private CaseInsensitiveMap.AbstractCollectionView()
           
 
Method Summary
 boolean add(java.lang.Object o)
          Adds the passed in element to this collection.
 boolean addAll(java.util.Collection c)
          Add all the elements found in the passed in collection to this collection.
 void clear()
          Remove all elements from this Set.
 boolean contains(java.lang.Object o)
          Returns true if the Collection contains the passed in object.
 boolean containsAll(java.util.Collection c)
          Returns true if this Set contains all the elements of the passed in Collection.
 boolean isEmpty()
          Returns true if the Collection doesn't contain any elements.
 boolean remove(java.lang.Object o)
          Removes the passed in element from the Collection.
 boolean removeAll(java.util.Collection c)
          Removes all the elements from this Collection that are in the passed in Collection.
 boolean retainAll(java.util.Collection c)
          Retains in this Collection only the elements found in the passed in Collection.
 int size()
          Returns the number of elements in the Collection.
 java.lang.Object[] toArray()
          Returns an array containing a copy of all the elements found in this Collection.
 java.lang.Object[] toArray(java.lang.Object[] os)
          Returns an array of the passed in type, containing a copy of all the elements found in this Collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode, iterator
 

Constructor Detail

CaseInsensitiveMap.AbstractCollectionView

private CaseInsensitiveMap.AbstractCollectionView()
Method Detail

size

public int size()
Returns the number of elements in the Collection.

Specified by:
size in interface java.util.Collection
Returns:
the number of elements in the Collection.

isEmpty

public boolean isEmpty()
Returns true if the Collection doesn't contain any elements.

Specified by:
isEmpty in interface java.util.Collection
Returns:
true if the Collection doesn't contain any elements.

contains

public boolean contains(java.lang.Object o)
Returns true if the Collection contains the passed in object.

Specified by:
contains in interface java.util.Collection
Parameters:
o - the Object to be checked for existence in this Collection
Returns:
true if the Colection contains the passed in object.

toArray

public java.lang.Object[] toArray()
Returns an array containing a copy of all the elements found in this Collection. The array isn't backed by the Collection, so it can be modified without affecting this Collection.

Specified by:
toArray in interface java.util.Collection
Returns:
an array containing a copy of all the elements found in this Collection.
See Also:
Collection.toArray()

toArray

public java.lang.Object[] toArray(java.lang.Object[] os)
Returns an array of the passed in type, containing a copy of all the elements found in this Collection. If the elements fit in the array passed in they will added to it, and the array will be returned. Otherwise a new array of the same type will be created, populated and returned. The array isn't backed by the Collection, so it can be modified without affecting this Collection.

Specified by:
toArray in interface java.util.Collection
Parameters:
os - an array that dictates the runtime-type of the array to be used.
Returns:
an array containing a copy of all the elements found in this Collection.
See Also:
Collection.toArray(Object[])

add

public boolean add(java.lang.Object o)
Adds the passed in element to this collection. This method is unsupported for this collection.

Specified by:
add in interface java.util.Collection
Parameters:
o - the Object to be added
Returns:
true if the set changed as the result of the call
Throws:
java.lang.UnsupportedOperationException - will always be thrown

addAll

public boolean addAll(java.util.Collection c)
Add all the elements found in the passed in collection to this collection. This operation is unsupported for this collection.

Specified by:
addAll in interface java.util.Collection
Parameters:
c - the collection of which elements should be added to this collection
Returns:
true if this Set changed as the result of this call
Throws:
java.lang.UnsupportedOperationException - will always be thrown

containsAll

public boolean containsAll(java.util.Collection c)
Returns true if this Set contains all the elements of the passed in Collection.

Specified by:
containsAll in interface java.util.Collection
Parameters:
c - a Collection of which elements should be checked
Returns:
true if this Set contains all the elements of the passed in Collection.

clear

public void clear()
Remove all elements from this Set.

Specified by:
clear in interface java.util.Collection

remove

public boolean remove(java.lang.Object o)
Removes the passed in element from the Collection.

Specified by:
remove in interface java.util.Collection
Parameters:
o - the element to be removed
Returns:
true if the Collection changed as the result of the call

removeAll

public boolean removeAll(java.util.Collection c)
Removes all the elements from this Collection that are in the passed in Collection.

Specified by:
removeAll in interface java.util.Collection
Parameters:
c - the Collection of which elements should be removed
Returns:
true if this Collection changed as the result of this call

retainAll

public boolean retainAll(java.util.Collection c)
Retains in this Collection only the elements found in the passed in Collection. In other words it deletes all the elements from this Collection, that are not in the passed in Collection.

Specified by:
retainAll in interface java.util.Collection
Parameters:
c - the Collection of which elements should be retained
Returns:
true if this Collection changed as the result of this call


Copyright © 2005 Frank W. Zammetti