This project has retired. For details please refer to its Attic page.
FilterFns (Apache Crunch 0.8.0 API)

org.apache.crunch.fn
Class FilterFns

java.lang.Object
  extended by org.apache.crunch.fn.FilterFns

public final class FilterFns
extends Object

A collection of pre-defined FilterFn implementations.


Method Summary
static
<S> FilterFn<S>
ACCEPT_ALL()
          Accept everything.
static
<S> FilterFn<S>
and(FilterFn<S>... fns)
          Accept an entry if all of the given filters accept it, using short-circuit evaluation.
static
<S> FilterFn<S>
and(FilterFn<S> fn1, FilterFn<S> fn2)
          Accept an entry if all of the given filters accept it, using short-circuit evaluation.
static
<S> FilterFn<S>
not(FilterFn<S> fn)
          Accept an entry if the given filter does not accept it.
static
<S> FilterFn<S>
or(FilterFn<S>... fns)
          Accept an entry if at least one of the given filters accept it, using short-circuit evaluation.
static
<S> FilterFn<S>
or(FilterFn<S> fn1, FilterFn<S> fn2)
          Accept an entry if at least one of the given filters accept it, using short-circuit evaluation.
static
<S> FilterFn<S>
REJECT_ALL()
          Reject everything.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

and

public static <S> FilterFn<S> and(FilterFn<S> fn1,
                                  FilterFn<S> fn2)
Accept an entry if all of the given filters accept it, using short-circuit evaluation.

Parameters:
fn1 - The first functions to delegate to
fn2 - The second functions to delegate to
Returns:
The composed filter function

and

public static <S> FilterFn<S> and(FilterFn<S>... fns)
Accept an entry if all of the given filters accept it, using short-circuit evaluation.

Parameters:
fns - The functions to delegate to (in the given order)
Returns:
The composed filter function

or

public static <S> FilterFn<S> or(FilterFn<S> fn1,
                                 FilterFn<S> fn2)
Accept an entry if at least one of the given filters accept it, using short-circuit evaluation.

Parameters:
fn1 - The first functions to delegate to
fn2 - The second functions to delegate to
Returns:
The composed filter function

or

public static <S> FilterFn<S> or(FilterFn<S>... fns)
Accept an entry if at least one of the given filters accept it, using short-circuit evaluation.

Parameters:
fns - The functions to delegate to (in the given order)
Returns:
The composed filter function

not

public static <S> FilterFn<S> not(FilterFn<S> fn)
Accept an entry if the given filter does not accept it.

Parameters:
fn - The function to delegate to
Returns:
The composed filter function

ACCEPT_ALL

public static <S> FilterFn<S> ACCEPT_ALL()
Accept everything.

Returns:
A filter function that accepts everything.

REJECT_ALL

public static <S> FilterFn<S> REJECT_ALL()
Reject everything.

Returns:
A filter function that rejects everything.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.