Plexus v0.13.1

com.phoenixst.collections
Class CollectionWrapper

java.lang.Object
  extended by java.util.AbstractCollection
      extended by com.phoenixst.collections.CollectionWrapper
All Implemented Interfaces:
Iterable, Collection

public class CollectionWrapper
extends AbstractCollection

A Collection which wraps another. This class is intended to be extended by overriding the wrapObject(java.lang.Object) and unwrapObject(java.lang.Object) methods.

Since:
1.0
Version:
$Revision: 1.9 $
Author:
Ray A. Conner

Constructor Summary
protected CollectionWrapper()
          This constructor, along with initialize(java.util.Collection), allows a subclass to initialize the internal state during deserialization.
  CollectionWrapper(Collection delegate)
          Creates a new CollectionWrapper.
 
Method Summary
 boolean add(Object object)
           
 boolean addAll(Collection collection)
           
 void clear()
           
 boolean contains(Object object)
           
 boolean containsAll(Collection collection)
           
protected  Collection getDelegate()
          Provides accesss to the internal state so it can be manually serialized by a subclass's writeObject() method.
protected  void initialize(Collection collection)
          This method should only be called by subclasses during deserialization.
 boolean isEmpty()
           
 Iterator iterator()
           
 boolean remove(Object object)
           
 boolean removeAll(Collection collection)
           
 boolean retainAll(Collection collection)
           
 int size()
           
 Object[] toArray()
           
 Object[] toArray(Object[] array)
           
 String toString()
           
protected  Object unwrapObject(Object object)
          Returns an unwrapped object.
protected  Object wrapObject(Object object)
          Returns a wrapped object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

CollectionWrapper

public CollectionWrapper(Collection delegate)
Creates a new CollectionWrapper.


CollectionWrapper

protected CollectionWrapper()
This constructor, along with initialize(java.util.Collection), allows a subclass to initialize the internal state during deserialization.

Method Detail

initialize

protected final void initialize(Collection collection)
This method should only be called by subclasses during deserialization.


getDelegate

protected final Collection getDelegate()
Provides accesss to the internal state so it can be manually serialized by a subclass's writeObject() method.


wrapObject

protected Object wrapObject(Object object)
Returns a wrapped object. This implementation returns the argument object.


unwrapObject

protected Object unwrapObject(Object object)
Returns an unwrapped object. This implementation returns the argument object.


size

public int size()
Specified by:
size in interface Collection
Specified by:
size in class AbstractCollection

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
Overrides:
isEmpty in class AbstractCollection

clear

public void clear()
Specified by:
clear in interface Collection
Overrides:
clear in class AbstractCollection

add

public boolean add(Object object)
Specified by:
add in interface Collection
Overrides:
add in class AbstractCollection

remove

public boolean remove(Object object)
Specified by:
remove in interface Collection
Overrides:
remove in class AbstractCollection

contains

public boolean contains(Object object)
Specified by:
contains in interface Collection
Overrides:
contains in class AbstractCollection

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in class AbstractCollection

addAll

public boolean addAll(Collection collection)
Specified by:
addAll in interface Collection
Overrides:
addAll in class AbstractCollection

containsAll

public boolean containsAll(Collection collection)
Specified by:
containsAll in interface Collection
Overrides:
containsAll in class AbstractCollection

removeAll

public boolean removeAll(Collection collection)
Specified by:
removeAll in interface Collection
Overrides:
removeAll in class AbstractCollection

retainAll

public boolean retainAll(Collection collection)
Specified by:
retainAll in interface Collection
Overrides:
retainAll in class AbstractCollection

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Overrides:
toArray in class AbstractCollection

toArray

public Object[] toArray(Object[] array)
Specified by:
toArray in interface Collection
Overrides:
toArray in class AbstractCollection

toString

public String toString()
Overrides:
toString in class AbstractCollection

Plexus v0.13.1

See the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.