public class NotFilter extends Filter
not()
method is invoked
on any other kind of Filter, this creates and returns a new NotFilter,
with the other Filter as its component.
NotFilter has an accept(Content)
method that returns true,
only if the component Filter returns false, when applied to the same
Content node. Likewise, it returns false if the component Filter returns
true. Using a NotFilter is the easiest way to construct a Filter accepting
"everything but" some specified pattern.
Modifier and Type | Field and Description |
---|---|
private Filter |
filter
The filter whose complement is matched by this NotFilter.
|
ALLCONTENT, NAMENODES, PARENTNODES, PROPERTYNODES, VALUENODES, XPATHNODES, XPATHTEXT
Constructor and Description |
---|
NotFilter(Filter other)
Creates an NotFilter accepting the logical complement of the other
Filter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Content node)
Reports whether a given Content node is accepted by this NotFilter.
|
protected AndFilter |
andNodeFilter(NodeFilter other)
Creates a Filter that is the logical-AND of this NotFilter and a
NodeFilter.
|
Filter |
not()
Creates a Filter that is the logical NOT of this NotFilter.
|
java.lang.String |
toString()
Returns a pretty representation of this Filter.
|
and, andIndexFilter, or, orNodeFilter
private Filter filter
public NotFilter(Filter other)
other
- a Filter.public boolean accept(Content node)
public Filter not()
protected AndFilter andNodeFilter(NodeFilter other)
andNodeFilter
in class Filter
other
- the other NodeFilter.