Package org.jdom2.filter
Interface Filter<T>
- Type Parameters:
T
- The Generic type of content returned by this Filter
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractFilter
,AttributeFilter
,ContentFilter
,ElementFilter
A generalized filter to restrict visibility or mutability on a list.
- Author:
- Jools Enticknap, Bradley S. Huffman, Rolf Lear
-
Method Summary
Modifier and TypeMethodDescriptionCreates an ANDing filter.Check to see if the content matches this Filter.Filter the input list keeping only the items that match the Filter.boolean
Check to see if the object matches a predefined set of rules.negate()
Creates an 'inverse' filterCreates an ORing filter<R> Filter
<R> This is similar to the and(Filter) method except the generic type is different.
-
Method Details
-
filter
Filter the input list keeping only the items that match the Filter.- Parameters:
content
- The content to filter.- Returns:
- a new read-only RandomAccess list of the filtered input content.
-
filter
Check to see if the content matches this Filter. If it does, return the content cast as this filter's return type, otherwise return null.- Parameters:
content
- The content to test.- Returns:
- The content if it matches the filter, cast as this Filter's type.
-
matches
Check to see if the object matches a predefined set of rules.- Parameters:
content
- The object to verify.- Returns:
true
if the object matches a predfined set of rules.
-
negate
Creates an 'inverse' filter- Returns:
- a Filter that returns all content except what this Filter instance would.
-
or
Creates an ORing filter- Parameters:
filter
- a second Filter to OR with.- Returns:
- a new Filter instance that returns the 'union' of this filter and the specified filter.
-
and
Creates an ANDing filter. The generic type of the result is the same as this Filter.- Parameters:
filter
- a second Filter to AND with.- Returns:
- a new Filter instance that returns the 'intersection' of this filter and the specified filter.
-
refine
This is similar to the and(Filter) method except the generic type is different.- 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 returned data is based on the refining instance, not this instance.
-