net.sf.mmm.util.filter.base
Class ConstantFilter<V>

java.lang.Object
  extended by net.sf.mmm.util.filter.base.ConstantFilter<V>
Type Parameters:
V - is the generic type of the filtered objects.
All Implemented Interfaces:
Filter<V>

public final class ConstantFilter<V>
extends Object
implements Filter<V>

This is an implementation of Filter that either accepts or rejects all objects to filter.

Since:
1.1.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private static ConstantFilter ACCEPT_ALL_FILTER
           
private static ConstantFilter REJECT_ALL_FILTER
           
 
Constructor Summary
private ConstantFilter()
          The constructor.
 
Method Summary
 boolean accept(V value)
          This method determines if the given value should be accepted.
static
<V> Filter<V>
getInstance(boolean accept)
          This method gets the an instance of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACCEPT_ALL_FILTER

private static final ConstantFilter ACCEPT_ALL_FILTER
See Also:
getInstance(boolean)

REJECT_ALL_FILTER

private static final ConstantFilter REJECT_ALL_FILTER
See Also:
getInstance(boolean)
Constructor Detail

ConstantFilter

private ConstantFilter()
The constructor.

Method Detail

accept

public boolean accept(V value)
This method determines if the given value should be accepted.

Specified by:
accept in interface Filter<V>
Parameters:
value - is the value to check.
Returns:
true if the given value is acceptable, false if it should be filtered.

getInstance

public static <V> Filter<V> getInstance(boolean accept)
This method gets the an instance of this class.

Type Parameters:
V - is the generic type of the filtered object.
Parameters:
accept - - true if the returned Filter should accept all objects, false to reject all objects.
Returns:
the requested filter.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.