Package docking.widgets.filter
Class AbstractPatternTextFilter
- java.lang.Object
-
- docking.widgets.filter.AbstractPatternTextFilter
-
- All Implemented Interfaces:
TextFilter
- Direct Known Subclasses:
FindsPatternTextFilter
,MatchesPatternTextFilter
public abstract class AbstractPatternTextFilter extends java.lang.Object implements TextFilter
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.regex.Pattern
filterPattern
protected java.lang.String
filterText
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPatternTextFilter(java.lang.String filterText)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.util.regex.Pattern
createPattern()
Subclasses must create thePattern
that will be used by this class when filtering.boolean
equals(java.lang.Object obj)
java.lang.String
getFilterText()
int
hashCode()
boolean
matches(java.lang.String text)
abstract boolean
matches(java.lang.String text, java.util.regex.Pattern pattern)
Subclasses implement this method for their usage of the given pattern (find vs.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface docking.widgets.filter.TextFilter
isSubFilterOf
-
-
-
-
Method Detail
-
createPattern
protected abstract java.util.regex.Pattern createPattern()
Subclasses must create thePattern
that will be used by this class when filtering.- Returns:
- the pattern
-
matches
public abstract boolean matches(java.lang.String text, java.util.regex.Pattern pattern)
Subclasses implement this method for their usage of the given pattern (find vs. matches)- Parameters:
text
- the text to check against the patternpattern
- the pattern used to match the text- Returns:
- true if there is a match
-
getFilterText
public java.lang.String getFilterText()
- Specified by:
getFilterText
in interfaceTextFilter
-
matches
public boolean matches(java.lang.String text)
- Specified by:
matches
in interfaceTextFilter
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-