Package org.jdom.filter2
Class AbstractFilter<T>
- java.lang.Object
-
- org.jdom.filter2.AbstractFilter<T>
-
- Type Parameters:
T- The Generic type of content returned by this Filter
- All Implemented Interfaces:
Serializable,Filter<T>
- Direct Known Subclasses:
AttributeFilter,ContentFilter,ElementFilter
public abstract class AbstractFilter<T> extends Object implements Filter<T>
Partial implementation ofFilter.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractFilter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Filter<T>and(Filter<?> filter)Creates an ANDing filter.List<T>filter(List<?> content)Filter the input list keeping only the items that match the Filter.booleanmatches(Object content)Check to see if the object matches a predefined set of rules.Filter<?>negate()Creates an 'inverse' filterFilter<? extends Content>or(Filter<?> filter)Creates an ORing filter<R> Filter<R>refine(Filter<R> filter)This is similar to the and(Filter) method except the generic type is different.static <E extends Content>
Filter<E>toFilter(Filter<E> filter)
-
-
-
Method Detail
-
matches
public final boolean matches(Object content)
Description copied from interface:FilterCheck to see if the object matches a predefined set of rules.
-
filter
public List<T> filter(List<?> content)
Description copied from interface:FilterFilter the input list keeping only the items that match the Filter.
-
negate
public final Filter<?> negate()
Description copied from interface:FilterCreates an 'inverse' filter
-
or
public final Filter<? extends Content> or(Filter<?> filter)
Description copied from interface:FilterCreates an ORing filter
-
and
public final Filter<T> and(Filter<?> filter)
Description copied from interface:FilterCreates an ANDing filter. The generic type of the result is the same as this Filter.
-
refine
public <R> Filter<R> refine(Filter<R> filter)
Description copied from interface:FilterThis is similar to the and(Filter) method except the generic type is different.- Specified by:
refinein interfaceFilter<T>- Type Parameters:
R- The Generic type of the returned data is taken from the input instance.- Parameters:
filter- The filter to refine our results with.- Returns:
- A Filter that requires content to both match our instance and the refining instance, but the generic type of the retuned data is based on the refining instance, not this instance.
-
-