Top Description Fields Constructors Methods
org.jdom2.filter

public abstract Class AbstractFilter<T>

extends Object
implements Filter<T>
Class Inheritance
All Implemented Interfaces
org.jdom2.filter.Filter, java.io.Serializable
Known Direct Subclasses
org.jdom2.filter.AndFilter, org.jdom2.filter.AttributeFilter, org.jdom2.filter.ClassFilter, org.jdom2.filter.ContentFilter, org.jdom2.filter.ElementFilter, org.jdom2.filter.NegateFilter, org.jdom2.filter.OrFilter, org.jdom2.filter.PassThroughFilter, org.jdom2.filter.TextOnlyFilter
Type Parameters
<T>
The Generic type of content returned by this Filter
Imports
java.util.ArrayList, .Collections, .Iterator, .List, .RandomAccess, org.jdom2.Content

Partial implementation of Filter.
Authors
Bradley S. Huffman, Rolf Lear

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

JDOM2 Serialization: Default mechanism

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final Filter<T>
and(Filter<?>
a second Filter to AND with.
filter
)

Implements org.jdom2.filter.Filter.and.

Creates an ANDing filter.
public List<T>
filter(List<?>
The content to filter.
content
)

Implements org.jdom2.filter.Filter.filter.

Filter the input list keeping only the items that match the Filter.
public final boolean
matches(Object
The object to verify.
content
)

Implements org.jdom2.filter.Filter.matches.

Check to see if the object matches a predefined set of rules.
public final Filter<?>
negate()

Implements org.jdom2.filter.Filter.negate.

Creates an 'inverse' filter
public final Filter<? extends Content>
or(Filter<?>
a second Filter to OR with.
filter
)

Implements org.jdom2.filter.Filter.or.

Creates an ORing filter
public <R> Filter<R>
refine(Filter<R>
The filter to refine our results with.
filter
)

Implements org.jdom2.filter.Filter.refine.

This is similar to the and(Filter) method except the generic type is different.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

JDOM2 Serialization: Default mechanism

Constructor Detail

AbstractFilterback to summary
public AbstractFilter()

Method Detail

andback to summary
public final Filter<T> and(Filter<?> filter)

Implements org.jdom2.filter.Filter.and.

Doc from org.jdom2.filter.Filter.and.

Creates an ANDing filter. The generic type of the result is the same as this Filter.

Parameters
filter:Filter<?>

a second Filter to AND with.

Returns:Filter<T>

a new Filter instance that returns the 'intersection' of this filter and the specified filter.

Annotations
@Override
filterback to summary
public List<T> filter(List<?> content)

Implements org.jdom2.filter.Filter.filter.

Doc from org.jdom2.filter.Filter.filter.

Filter the input list keeping only the items that match the Filter.

Parameters
content:List<?>

The content to filter.

Returns:List<T>

a new read-only RandomAccess list of the filtered input content.

Annotations
@Override
matchesback to summary
public final boolean matches(Object content)

Implements org.jdom2.filter.Filter.matches.

Doc from org.jdom2.filter.Filter.matches.

Check to see if the object matches a predefined set of rules.

Parameters
content:Object

The object to verify.

Returns:boolean

true if the object matches a predfined set of rules.

Annotations
@Override
negateback to summary
public final Filter<?> negate()

Implements org.jdom2.filter.Filter.negate.

Doc from org.jdom2.filter.Filter.negate.

Creates an 'inverse' filter

Returns:Filter<?>

a Filter that returns all content except what this Filter instance would.

Annotations
@Override
orback to summary
public final Filter<? extends Content> or(Filter<?> filter)

Implements org.jdom2.filter.Filter.or.

Doc from org.jdom2.filter.Filter.or.

Creates an ORing filter

Parameters
filter:Filter<?>

a second Filter to OR with.

Returns:Filter<? extends Content>

a new Filter instance that returns the 'union' of this filter and the specified filter.

Annotations
@Override
refineback to summary
public <R> Filter<R> refine(Filter<R> filter)

Implements org.jdom2.filter.Filter.refine.

Doc from org.jdom2.filter.Filter.refine.

This is similar to the and(Filter) method except the generic type is different.

Parameters
<R>
The Generic type of the returned data is taken from the input instance.
filter:Filter<R>

The filter to refine our results with.

Returns:Filter<R>

A Filter that requires content to both match our instance and the refining instance, but the generic type of the returned data is based on the refining instance, not this instance.

Annotations
@Override