public final class CharSet extends Object implements ImmutableSortedListOfRanges, Comparable<CharSet>, JsonConvertible
ImmutableSortedListOfRanges.IntersectAndSubtractResult<T extends ImmutableSortedListOfRanges>| Modifier and Type | Method and Description |
|---|---|
void |
appendRangesTo(RangesBuffer buffer,
int startIndex,
int endIndex)
Append all ranges from
startIndex (inclusive) to endIndex (exclusive) to the
given buffer. |
int |
compareTo(CharSet o) |
static CharSet |
create(char... ranges) |
static CharSet |
create(CharRangesBuffer buf) |
CharSet |
create(RangesBuffer buffer)
Returns an immutable equivalent of the given
buffer. |
CharSet |
createEmpty()
Returns an empty list.
|
CharSet |
createFull()
|
CharSet |
createInverse()
Returns a list containing all values of [
SortedListOfRanges.getMinValue() SortedListOfRanges.getMaxValue()]
not contained in this list. |
static CharSet |
createInverse(SortedListOfRanges src) |
CharMatcher |
createMatcher(CompilationBuffer compilationBuffer) |
CharRangesBuffer |
createTempBuffer()
Creates a new buffer that is compatible with this list's storage implementation.
|
boolean |
equals(Object obj) |
boolean |
equalsBuffer(RangesBuffer buffer)
Returns
true if this list equals buffer. |
static CharSet |
fromSortedRanges(SortedListOfRanges codePointSet) |
CharRangesBuffer |
getBuffer1(CompilationBuffer compilationBuffer)
Returns a buffer from the given
compilationBuffer that is compatible with this list's
storage implementation. |
CharRangesBuffer |
getBuffer2(CompilationBuffer compilationBuffer)
Returns a buffer from the given
compilationBuffer that is compatible with this list's
storage implementation. |
CharRangesBuffer |
getBuffer3(CompilationBuffer compilationBuffer)
Returns a buffer from the given
compilationBuffer that is compatible with this list's
storage implementation. |
static CharSet |
getEmpty() |
static CharSet |
getFull() |
int |
getHi(int i)
Returns the inclusive upper bound of the range stored at index
i. |
int |
getLo(int i)
Returns the inclusive lower bound of the range stored at index
i. |
int |
getMaxValue()
Returns the maximum value that may be contained in an instance of this list.
|
int |
getMinValue()
Returns the minimum value that may be contained in an instance of this list.
|
char[] |
getRanges() |
static CharSet |
getTrailSurrogateRange() |
int |
hashCode() |
char[] |
inverseToCharArray() |
boolean |
matchesEverything()
Returns
true if this list is equal to [SortedListOfRanges.getMinValue() SortedListOfRanges.getMaxValue()
]. |
boolean |
matchesNothing()
Returns
true if this list is empty. |
static String |
rangesToString(char[] ranges) |
static String |
rangesToString(char[] ranges,
boolean numeric) |
int |
size()
Returns the number of disjoint ranges contained in this list.
|
JsonValue |
toJson() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcreateIntersection, createIntersection, intersectAndSubtract, subtract, union, union, unionaddRangeTo, adjacent, adjacent, adjacent, binarySearch, binarySearchExactMatch, binarySearchExactMatch, binarySearchGetFirstIntersecting, binarySearchGetFirstIntersecting, binarySearchGetFirstIntersectingOrAdjacent, binarySearchGetFirstIntersectingOrAdjacent, binarySearchNoIntersectingFound, containedBy, contains, contains, contains, contains, contains, defaultToString, equal, equal, equalsListOfRanges, intersects, intersects, intersects, intersects, inverseRangesToString, inverseValueCount, isEmpty, isSingle, leftOf, leftOf, leftOf, leftOf, matches2CharsWith1BitDifference, matchesSingleAscii, matchesSingleChar, matchesSomething, rangesAreSortedAndDisjoint, rangesToString, rangeToString, rightOf, rightOf, rightOf, rightOf, size, sizeOfInverse, union, valueCountpublic char[] getRanges()
public static CharSet getEmpty()
public static CharSet getFull()
public static CharSet getTrailSurrogateRange()
public static CharSet create(char... ranges)
public static CharSet create(CharRangesBuffer buf)
public static CharSet fromSortedRanges(SortedListOfRanges codePointSet)
public boolean matchesNothing()
SortedListOfRangestrue if this list is empty.matchesNothing in interface SortedListOfRangespublic boolean matchesEverything()
SortedListOfRangestrue if this list is equal to [SortedListOfRanges.getMinValue() SortedListOfRanges.getMaxValue()
].matchesEverything in interface SortedListOfRangespublic CharSet createEmpty()
ImmutableSortedListOfRangescreateEmpty in interface ImmutableSortedListOfRangespublic CharSet createFull()
ImmutableSortedListOfRangescreateFull in interface ImmutableSortedListOfRangespublic CharSet create(RangesBuffer buffer)
ImmutableSortedListOfRangesbuffer.create in interface ImmutableSortedListOfRangespublic int getMinValue()
SortedListOfRangesgetMinValue in interface SortedListOfRangespublic int getMaxValue()
SortedListOfRangesgetMaxValue in interface SortedListOfRangespublic int getLo(int i)
SortedListOfRangesi.getLo in interface SortedListOfRangespublic int getHi(int i)
SortedListOfRangesi.getHi in interface SortedListOfRangespublic int size()
SortedListOfRangessize in interface SortedListOfRangespublic CharRangesBuffer getBuffer1(CompilationBuffer compilationBuffer)
ImmutableSortedListOfRangescompilationBuffer that is compatible with this list's
storage implementation.getBuffer1 in interface ImmutableSortedListOfRangespublic CharRangesBuffer getBuffer2(CompilationBuffer compilationBuffer)
ImmutableSortedListOfRangescompilationBuffer that is compatible with this list's
storage implementation.getBuffer2 in interface ImmutableSortedListOfRangespublic CharRangesBuffer getBuffer3(CompilationBuffer compilationBuffer)
ImmutableSortedListOfRangescompilationBuffer that is compatible with this list's
storage implementation.getBuffer3 in interface ImmutableSortedListOfRangespublic CharRangesBuffer createTempBuffer()
ImmutableSortedListOfRangescreateTempBuffer in interface ImmutableSortedListOfRangespublic void appendRangesTo(RangesBuffer buffer, int startIndex, int endIndex)
SortedListOfRangesstartIndex (inclusive) to endIndex (exclusive) to the
given buffer. The caller is responsible for not violating the target buffer's
sortedness; This effectively means that the range at startIndex must be
rightOf the buffer's last range.appendRangesTo in interface SortedListOfRangespublic boolean equalsBuffer(RangesBuffer buffer)
ImmutableSortedListOfRangestrue if this list equals buffer.equalsBuffer in interface ImmutableSortedListOfRangespublic CharSet createInverse()
ImmutableSortedListOfRangesSortedListOfRanges.getMinValue() SortedListOfRanges.getMaxValue()]
not contained in this list.createInverse in interface ImmutableSortedListOfRangespublic static CharSet createInverse(SortedListOfRanges src)
public CharMatcher createMatcher(CompilationBuffer compilationBuffer)
public char[] inverseToCharArray()
public static String rangesToString(char[] ranges)
public static String rangesToString(char[] ranges, boolean numeric)
public int compareTo(CharSet o)
compareTo in interface Comparable<CharSet>public JsonValue toJson()
toJson in interface JsonConvertible