public class TextMatcher extends Object
TextMatcher.Kind.REGULAR
,
TextMatcher.Kind.EQUALS
,
TextMatcher.Kind.CONTAINS
Modifier and Type | Class and Description |
---|---|
static class |
TextMatcher.Kind
A kind of comparison a TextMatcher can perform.
|
Constructor and Description |
---|
TextMatcher(TextMatcher.Kind kind,
String filter,
boolean caseSensitive,
boolean diacriticalSensitive)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Tests whether the argument object is equals to this.
|
String |
getFilter()
Gets the filter string.
|
TextMatcher.Kind |
getKind()
Gets the kind of comparison.
|
int |
hashCode() |
boolean |
isCaseSensitive()
Tests whether this matcher is case sensitive.
|
boolean |
isDiacriticalSensitive()
Tests whether this matcher is diacritical sensitive.
|
boolean |
matches(String text)
Tests whether a string matches this matcher.
|
static String |
removeDiacriticals(String string)
Removes the diacritical marks from a string.
|
public TextMatcher(TextMatcher.Kind kind, String filter, boolean caseSensitive, boolean diacriticalSensitive)
kind
- The kind of matcher.filter
- The filter stringcaseSensitive
- sets the case sensitivity of the comparison (true if the comparison is case sensitive)diacriticalSensitive
- sets the diacritical sensitivity of the comparison (false to ignore diacritical marks).TextMatcher.Kind.REGULAR
,
TextMatcher.Kind.EQUALS
,
TextMatcher.Kind.CONTAINS
public static String removeDiacriticals(String string)
string
- The string to processpublic TextMatcher.Kind getKind()
TextMatcher.Kind.REGULAR
,
TextMatcher.Kind.EQUALS
,
TextMatcher.Kind.CONTAINS
public String getFilter()
public boolean isCaseSensitive()
public boolean isDiacriticalSensitive()
public boolean matches(String text)
text
- the string to testpublic boolean equals(Object obj)
equals
in class Object
obj
- a textMatcher to test.TextMatcher(Kind, String, boolean, boolean)
Copyright © 2022. All rights reserved.