JAPI 0.9.0
Yet another Java API
API Documentation

net.sf.japi.util.filter
Class Filter.Factory

java.lang.Object
  extended by net.sf.japi.util.filter.Filter.Factory
Enclosing interface:
Filter<T>

public static final class Filter.Factory
extends Object

Factory for useful filters.

Author:
Christian Hujer

Method Summary
static
<T> Filter<T>
and(Filter<T>... filters)
          Create a Filter that is the AND combination of several other filters.
static
<T> Filter<T>
and(Iterable<Filter<T>> filters)
          Create a Filter that is the AND combination of several other filters.
static
<T> Filter<T>
contained(Collection<T> collection)
          Create a Filter that returns whether an element is contained in a collection.
static
<T> Filter<T>
not(Filter<T> filter)
          Create a Filter that is the opposite of another filter.
static
<T> Filter<T>
or(Filter<T>... filters)
          Create a Filter that is the OR combination of several other filters.
static
<T> Filter<T>
or(Iterable<Filter<T>> filters)
          Create a Filter that is the OR combination of several other filters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

not

public static <T> Filter<T> not(Filter<T> filter)
Create a Filter that is the opposite of another filter.

Parameters:
filter - Filter to negate
Returns:
negated version of filter

and

public static <T> Filter<T> and(Iterable<Filter<T>> filters)
Create a Filter that is the AND combination of several other filters.

Parameters:
filters - Filters to AND
Returns:
AND version of filters

and

public static <T> Filter<T> and(Filter<T>... filters)
Create a Filter that is the AND combination of several other filters.

Parameters:
filters - Filters to AND
Returns:
AND version of filters

or

public static <T> Filter<T> or(Iterable<Filter<T>> filters)
Create a Filter that is the OR combination of several other filters.

Parameters:
filters - Filters to OR
Returns:
OR version of filters

or

public static <T> Filter<T> or(Filter<T>... filters)
Create a Filter that is the OR combination of several other filters.

Parameters:
filters - Filters to OR
Returns:
OR version of filters

contained

public static <T> Filter<T> contained(Collection<T> collection)
Create a Filter that returns whether an element is contained in a collection. Note: The collection is not cloned. Changes to the underlying collection will affect the filter behaviour. If you need a stable filter, you have to clone the collection before invoking this method

Parameters:
collection - Collection to use as a base
Returns:
Filter that returns whether an element is contained in a collection

JAPI
Yet another Java API
API Documentation

© 2005-2006 Christian Hujer. All rights reserved. See copyright