org.incava.util

Class Collect


public abstract class Collect
extends ArrayList

Collects a collections into a collection.

Constructor Summary

Collect(Collection c)
Creates a new collection, where the condition passes the condition.
Collect(Object[] ary)
Ditto, but for real arrays.

Method Summary

Object
block(Object obj)
Returns the object to add to the collection.
abstract boolean
where(Object obj)
Must be defined to return where the given object satisfies the condition.

Constructor Details

Collect

public Collect(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(Object[] ary)
Ditto, but for real arrays.

Method Details

block

public Object block(Object obj)
Returns the object to add to the collection.
Parameters:
obj - An object from the collection passed to the constructor.

where

public abstract boolean where(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.