org.jcrom.util
Class NameFilter
java.lang.Object
org.jcrom.util.NameFilter
public class NameFilter
- extends java.lang.Object
This class represents a simple filter that can be used to filter names.
The filter is either an inclusion or exclusion filter. The filter is
constructed with a comma separated list of names, e.g. "photos,comments"
(reads: include photos and comments).
An exclusion filter is built by prefixing the list with a minus sign, e.g.
"-photos" (reads: include everything apart from photos).
The isIncluded() method can then be used to check if a specific name
gets through the filter or not.
Two special values are recognized: "*" means isIncluded() always returns
true, and "none" means isIncluded() will always return false.
- Author:
- Olafur Gauti Gudmundsson
|
Constructor Summary |
NameFilter(java.lang.String filterStr)
|
|
Method Summary |
java.lang.String |
getFilterStr()
|
boolean |
isIncluded(java.lang.String name)
Check whether the name supplied gets through the filter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NameFilter
public NameFilter(java.lang.String filterStr)
getFilterStr
public java.lang.String getFilterStr()
isIncluded
public boolean isIncluded(java.lang.String name)
- Check whether the name supplied gets through the filter.
- Parameters:
name - the name to check
- Returns:
- true if the name gets through the filter, else false
Copyright © 2009. All Rights Reserved.