com.jidesoft.filter
Class WildcardFilter<T>
java.lang.Object
com.jidesoft.filter.AbstractFilter<T>
com.jidesoft.filter.RegexFilter<T>
com.jidesoft.filter.WildcardFilter<T>
- All Implemented Interfaces:
- Filter<T>, ObjectGrouperSupport, Serializable, Cloneable
- Direct Known Subclasses:
- AutoFilterUtils.TableWildcardFilter
public class WildcardFilter<T>
- extends RegexFilter<T>
A filter implements filtering a string based the wildcards. It uses the following three chars as the wildcards.
- '?' The question mark indicates there is exact one of missing element. For example, colo?r matches
"colour" but not "color" or "colouur".
- '*' The asterisk indicates there are zero or more of the missing elements. For example, ab*c matches
"abc", "abbc", "abdbc", and so on.
- '+' The plus sign indicates there are at least one of the missing elements. For example, ab+c matches
"abbc", "abdbc", but not "abc".
- See Also:
- Serialized Form
Methods inherited from class com.jidesoft.filter.RegexFilter |
convertElementToString, createRegexPattern, getPattern, getPreference, isBeginWith, isCaseSensitive, isEndWith, setBeginWith, setCaseSensitive, setEndWith, setPreference, stricterThan |
Methods inherited from class com.jidesoft.filter.AbstractFilter |
addFilterListener, clone, fireFilterChanged, fireFilterContentChanged, fireFilterDisabled, fireFilterEnabled, fireFilterNameChanged, getConditionString, getFilterFactory, getFilterFactoryName, getFilterListeners, getName, getObjectGrouper, getObjectGrouperName, isEnabled, isFilterValid, removeFilterListener, setEnabled, setFilterFactory, setFilterFactoryName, setName, setObjectGrouper, setObjectGrouperName |
WildcardFilter
public WildcardFilter()
WildcardFilter
public WildcardFilter(String pattern)
setPattern
public void setPattern(String pattern)
- Description copied from class:
RegexFilter
- Sets the pattern.
- Overrides:
setPattern
in class RegexFilter<T>
- Parameters:
pattern
- the new pattern.- See Also:
Pattern
convertFromPatternToRegex
protected String convertFromPatternToRegex(String pattern)
- Converts the wildcards enabled pattern to the pattern used in Java Pattern class.
- Overrides:
convertFromPatternToRegex
in class RegexFilter<T>
- Parameters:
pattern
- the input pattern.
- Returns:
- the pattern string used by
Pattern
.
isValueFiltered
public boolean isValueFiltered(T value)
- Description copied from interface:
Filter
- Checks to see if the value should be filtered.
- Specified by:
isValueFiltered
in interface Filter<T>
- Overrides:
isValueFiltered
in class RegexFilter<T>
- Parameters:
value
- the value to filter
- Returns:
- true if the value should be filtered. Otherwise false.
equals
public boolean equals(Object obj)
- Overrides:
equals
in class RegexFilter<T>