|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.vgrs.xcode.common.UnicodeFilter
public class UnicodeFilter
Implements a set of Unicode codepoints and operations to determine whether certain codepoints fall inside or outside the set. Two different data structures are used to store codepoints internally.
| Field Summary | |
|---|---|
static int |
RANGE_THRESHOLD
This is the maximum number of ranges to allow on a plane before converting the data to a matrix. |
static int |
UNICODE_PLANES
The set of Unicode points is defined on the values 0 - 0x10ffff. |
| Constructor Summary | |
|---|---|
UnicodeFilter()
Construct a UnicodeFilter |
|
UnicodeFilter(java.lang.String aPrefix)
|
|
| Method Summary | |
|---|---|
void |
add(java.util.Collection<Range> aRanges)
Stores the collection of Range objects in the filter |
void |
add(int aPoint)
Adds the given code point to the filter |
void |
add(Range aRange)
Store a range of integers in the UnicodeFilter. |
void |
add(Range[] aRanges)
Adds an array of Range objects to the filter |
void |
assertAll(int[] aPoints)
Asserts that the input array of code points exist in the filter. |
void |
assertNone(int[] aPoints)
We know the exact offending codepoint at test time. |
java.lang.String |
getPrefix()
|
boolean |
has(int aPoint)
Test for intersection between a single integer and the UnicodeFilter |
boolean |
hasAll(int[] aPoints)
Test for a non-zero intersection between an integer array and the UnicodeFilter |
boolean |
hasNone(int[] aPoints)
Test for a zero intersection between an integer array and the UnicodeFilter |
void |
setPrefix(java.lang.String aPrefix)
|
java.lang.String |
toFullString()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int RANGE_THRESHOLD
public static final int UNICODE_PLANES
| Constructor Detail |
|---|
public UnicodeFilter()
public UnicodeFilter(java.lang.String aPrefix)
aPrefix - A string prefix associated with this filter| Method Detail |
|---|
public void add(java.util.Collection<Range> aRanges)
throws XcodeException
Filter
add in interface FilteraRanges - collection of Range objects to add to the filter
XcodeException
public void add(int aPoint)
throws XcodeException
Filter
add in interface FilteraPoint - the code point to add to the filter
XcodeException
public void add(Range aRange)
throws XcodeException
add in interface FilteraRange - An integer array of length two. The first element is the lower bound
and the second element is the upper bound.
XcodeException - If range is not valid Unicode
public void add(Range[] aRanges)
throws XcodeException
Filter
add in interface FilteraRanges - Array of Range objects to add to the filter
XcodeException
public void assertAll(int[] aPoints)
throws XcodeException
Filter
assertAll in interface FilteraPoints - input array of code points to check if they are in the filter
XcodeException
public void assertNone(int[] aPoints)
throws XcodeException
assertNone in interface FilteraPoints - input array of code points to check if they are not present in the
filter
XcodeExceptionpublic java.lang.String getPrefix()
public boolean has(int aPoint)
has in interface FilteraPoint - An integer
XcodeException - If an intersection is foundpublic boolean hasAll(int[] aPoints)
hasAll in interface FilteraPoints - An integer array
XcodeException - If code points are not valid Unicodepublic boolean hasNone(int[] aPoints)
hasNone in interface FilteraPoints - An integer array
XcodeException - If code points are not valid Unicodepublic void setPrefix(java.lang.String aPrefix)
aPrefix - the prefix identifying this UnicodeFilterpublic java.lang.String toFullString()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||