public abstract class UCPFilter extends Object
Charset instances.
For charset-based filters, this class may perform slowly when the cache is built, if the JVM is running with an active debugging agent. This is because the JRE implements the acceptability test by throwing and catching an exception, which is trapped by the agent; if the charset can only encode a small subset of the Unicode code points, then a lot of exceptions are thrown and caught, resulting in a performance degradation as the agent intercepts repeatedly (even if the debugger does not indicate an interest in exceptions).
| Modifier and Type | Field and Description |
|---|---|
static UCPFilter |
ALNUM
A filter for Unicode code points that are letters or digits.
|
static UCPFilter |
CHAR
A filter for Unicode characters that can be represented by a
single char.
|
static UCPFilter |
DIGIT
A filter for Unicode code points that are digits.
|
static UCPFilter |
LETTER
A filter for Unicode code points that are letters.
|
static UCPFilter |
VALID
A filter for Unicode characters deemed valid by
StringUtils.isValid(int). |
| Constructor and Description |
|---|
UCPFilter() |
| Modifier and Type | Method and Description |
|---|---|
static UCPFilter |
forCharset(Charset cs)
Returns a filter for Unicode code points that can be encoded by
the given charset.
|
static UCPFilter |
getDefaultCharset()
Returns a filter for Unicode code points that can be encoded by
the default JVM charset.
|
static UCPFilter |
getFileSystemCharset()
Returns a filter for Unicode code points that can be encoded by
the current system file encoding/charset (as specified in the
system property
file.encoding). |
abstract boolean |
isAcceptable(int ucp)
Checks whether the given Unicode code point is acceptable to
the receiver.
|
public static final UCPFilter VALID
StringUtils.isValid(int).public static final UCPFilter CHAR
public static final UCPFilter DIGIT
public static final UCPFilter LETTER
public static final UCPFilter ALNUM
public static UCPFilter forCharset(Charset cs)
cs - The charset.public static final UCPFilter getDefaultCharset()
public static final UCPFilter getFileSystemCharset()
file.encoding).public abstract boolean isAcceptable(int ucp)
ucp - The code point.Copyright © 2015. All Rights Reserved.