Plexus v0.13.1

com.phoenixst.collections
Class FilteredCollection

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

public class FilteredCollection
extends AbstractCollection
implements Serializable

A Collection which presents a filtered view of another.

Since:
1.0
Version:
$Revision: 1.11 $
Author:
Ray A. Conner
See Also:
Serialized Form

Constructor Summary
FilteredCollection(Collection delegate, org.apache.commons.collections.Predicate predicate)
          Creates a new FilteredCollection.
 
Method Summary
 boolean add(Object object)
           
 boolean contains(Object object)
           
 boolean isEmpty()
           
 Iterator iterator()
          Returns an Iterator over the elements of this Collection.
 boolean remove(Object object)
           
 int size()
           
 
Methods inherited from class java.util.AbstractCollection
addAll, clear, containsAll, removeAll, retainAll, toArray, toArray, toString
 
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

FilteredCollection

public FilteredCollection(Collection delegate,
                          org.apache.commons.collections.Predicate predicate)
Creates a new FilteredCollection. If a null Predicate is passed to this constructor, TruePredicate is used internally.

Method Detail

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

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()
Returns an Iterator over the elements of this Collection. If the remove() method is called after hasNext() without an intervening call to next(), the last element returned by next() will be removed by calling Collection.remove( object ) on the underlying Collection. Depending upon the underlying Collection implementation, this may invalidate this Iterator.

Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator 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.