org.incava.util
Class Collect

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by org.incava.util.Collect
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public abstract class Collect
extends java.util.ArrayList

Collects a collections into a collection.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Collect(java.util.Collection c)
          Creates a new collection, where the condition passes the condition.
Collect(java.lang.Object[] ary)
          Ditto, but for real arrays.
 
Method Summary
 java.lang.Object block(java.lang.Object obj)
          Returns the object to add to the collection.
abstract  boolean where(java.lang.Object obj)
          Must be defined to return where the given object satisfies the condition.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode
 
Methods inherited from class java.util.AbstractCollection
containsAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode
 

Constructor Detail

Collect

public Collect(java.util.Collection c)
Creates a new collection, where the condition passes the condition.

Parameters:
c - The collection from which to build the new collection.

Collect

public Collect(java.lang.Object[] ary)
Ditto, but for real arrays.

Method Detail

where

public abstract boolean where(java.lang.Object obj)
Must be defined to return where the given object satisfies the condition.

Parameters:
obj - An object from the collection passed to the constructor.

block

public java.lang.Object block(java.lang.Object obj)
Returns the object to add to the collection.

Parameters:
obj - An object from the collection passed to the constructor.