net.sf.mmm.util.filter.base
Class ListCharFilter
java.lang.Object
net.sf.mmm.util.filter.base.ListCharFilter
- All Implemented Interfaces:
- CharFilter
public class ListCharFilter
- extends Object
- implements CharFilter
This is an implementation of the CharFilter interface that
filters characters according to a
given blacklist or
whitelist.
- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
|
Constructor Summary |
ListCharFilter(boolean accept,
char... charArray)
The constructor. |
|
Method Summary |
boolean |
accept(char c)
This method determines if the given character c should be
accepted. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
blacklist
private boolean blacklist
- See Also:
accept(char)
chars
private final char[] chars
- See Also:
accept(char)
ListCharFilter
public ListCharFilter(boolean accept,
char... charArray)
- The constructor.
- Parameters:
accept - - if true exactly the chars given by
charArray are accepted (whitelist), if
false exactly these chars are NOT accepted (blacklist).charArray - are the chars to accept or to reject.
accept
public boolean accept(char c)
- This method determines if the given character
c should be
accepted.
- Specified by:
accept in interface CharFilter
- Parameters:
c - is the character to check.
- Returns:
true if the given character c is
acceptable, false if it should be filtered.
Copyright © 2001-2010 mmm-Team. All Rights Reserved.