net.cscott.jutil

Class CollectionWrapper<E>

public abstract class CollectionWrapper<E> extends Object implements Collection<E>

CollectionWrapper is a class that acts as a wrapper around another Collection, using it as its backing store. This class isn't meant for direct usage, but rather provides for an easy way for developers to quickly add extra independent behavior to their own specific Collections without having to reimplement all of AbstractCollection's interface

Version: $Id: CollectionWrapper.java,v 1.4 2006-10-30 19:58:05 cananian Exp $

Author: Felix S. Klock II

Constructor Summary
protected CollectionWrapper()
Creates a CollectionWrapper.
Method Summary
booleanadd(E o)
booleanaddAll(Collection<? extends E> c)
voidclear()
booleancontains(Object o)
booleancontainsAll(Collection<?> c)
booleanisEmpty()
Iterator<E>iterator()
booleanremove(Object o)
booleanremoveAll(Collection<?> c)
booleanretainAll(Collection<?> c)
intsize()
Object[]toArray()
<T> T[]toArray(T[] a)
protected abstract Collection<E>wrapped()
Implementations should return the wrapped Collection here.

Constructor Detail

CollectionWrapper

protected CollectionWrapper()
Creates a CollectionWrapper.

Method Detail

add

public boolean add(E o)

addAll

public boolean addAll(Collection<? extends E> c)

clear

public void clear()

contains

public boolean contains(Object o)

containsAll

public boolean containsAll(Collection<?> c)

isEmpty

public boolean isEmpty()

iterator

public Iterator<E> iterator()

remove

public boolean remove(Object o)

removeAll

public boolean removeAll(Collection<?> c)

retainAll

public boolean retainAll(Collection<?> c)

size

public int size()

toArray

public Object[] toArray()

toArray

public <T> T[] toArray(T[] a)

wrapped

protected abstract Collection<E> wrapped()
Implementations should return the wrapped Collection here.
Copyright (c) 2006 C. Scott Ananian