public final class CodePointSet extends Object implements ImmutableSortedListOfRanges, Comparable<CodePointSet>, Iterable<Range>, JsonConvertible
ImmutableSortedListOfRanges.IntersectAndSubtractResult<T extends ImmutableSortedListOfRanges>| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_VALUE |
static int |
MIN_VALUE |
| 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(CodePointSet o) |
static CodePointSet |
create(int... ranges) |
static CodePointSet |
create(int single) |
static CodePointSet |
create(IntRangesBuffer buf) |
CodePointSet |
create(RangesBuffer buffer)
Returns an immutable equivalent of the given
buffer. |
CodePointSet |
createEmpty()
Returns an empty list.
|
CodePointSet |
createFull()
|
CodePointSet |
createInverse()
Returns a list containing all values of [
SortedListOfRanges.getMinValue() SortedListOfRanges.getMaxValue()]
not contained in this list. |
static CodePointSet |
createInverse(SortedListOfRanges src) |
static CodePointSet |
createNoDedup(int... ranges) |
IntRangesBuffer |
createTempBuffer()
Creates a new buffer that is compatible with this list's storage implementation.
|
String |
dumpRaw() |
boolean |
equals(Object obj) |
boolean |
equalsBuffer(RangesBuffer buffer)
Returns
true if this list equals buffer. |
IntRangesBuffer |
getBuffer1(CompilationBuffer compilationBuffer)
Returns a buffer from the given
compilationBuffer that is compatible with this list's
storage implementation. |
IntRangesBuffer |
getBuffer2(CompilationBuffer compilationBuffer)
Returns a buffer from the given
compilationBuffer that is compatible with this list's
storage implementation. |
IntRangesBuffer |
getBuffer3(CompilationBuffer compilationBuffer)
Returns a buffer from the given
compilationBuffer that is compatible with this list's
storage implementation. |
static CodePointSet |
getEmpty() |
static CodePointSet |
getFull() |
int |
getHi(int i)
Returns the inclusive upper bound of the range stored at index
i. |
char |
getHi16(int i)
Get the upper bound of range
i in this set, interpreted as a set of char /
16-bit values. |
int |
getLo(int i)
Returns the inclusive lower bound of the range stored at index
i. |
char |
getLo16(int i)
Get the lower bound of range
i in this set, interpreted as a set of char /
16-bit values. |
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.
|
int[] |
getRanges() |
int |
hashCode() |
boolean |
inverseIsSameHighByte16Bit()
Returns
true iff not all values of this range set - interpreted as 16-bit values -
have the same high byte, but that would be the case in the inverse of this range set. |
char[] |
inverseToCharArray() |
Iterator<Range> |
iterator() |
Iterator<Range> |
iterator16Bit() |
int |
numberOf16BitRanges()
Returns the number ranges in this set, interpreted as a set of
char / 16-bit values. |
int |
size()
Returns the number of disjoint ranges contained in this list.
|
int |
size16()
Get the number of ranges in this set, interpreted as a set of
char / 16-bit values. |
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, getMax, getMin, intersects, intersects, intersects, intersects, inverseRangesToString, inverseValueCount, isEmpty, isSingle, leftOf, leftOf, leftOf, leftOf, matches2CharsWith1BitDifference, matchesEverything, matchesMinAndMax, matchesNothing, matchesSingleAscii, matchesSingleChar, matchesSomething, rangesAreSortedAndDisjoint, rangesToString, rightOf, rightOf, rightOf, rightOf, size, sizeOfInverse, union, valueCount, valueCountEquals, valueCountMaxforEach, spliteratorpublic static final int MIN_VALUE
public static final int MAX_VALUE
public int[] getRanges()
public static CodePointSet getEmpty()
public static CodePointSet getFull()
public static CodePointSet createNoDedup(int... ranges)
public static CodePointSet create(int single)
public static CodePointSet create(int... ranges)
public static CodePointSet create(IntRangesBuffer buf)
public CodePointSet createEmpty()
ImmutableSortedListOfRangescreateEmpty in interface ImmutableSortedListOfRangespublic CodePointSet createFull()
ImmutableSortedListOfRangescreateFull in interface ImmutableSortedListOfRangespublic CodePointSet 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 int size16()
char / 16-bit values.
This interpretation is valid iff the set contains either none or all code points above
Character.MAX_VALUE.public char getLo16(int i)
i in this set, interpreted as a set of char /
16-bit values. This interpretation is valid iff the set contains either none or all code
points above Character.MAX_VALUE.public char getHi16(int i)
i in this set, interpreted as a set of char /
16-bit values. This interpretation is valid iff the set contains either none or all code
points above Character.MAX_VALUE.public IntRangesBuffer getBuffer1(CompilationBuffer compilationBuffer)
ImmutableSortedListOfRangescompilationBuffer that is compatible with this list's
storage implementation.getBuffer1 in interface ImmutableSortedListOfRangespublic IntRangesBuffer getBuffer2(CompilationBuffer compilationBuffer)
ImmutableSortedListOfRangescompilationBuffer that is compatible with this list's
storage implementation.getBuffer2 in interface ImmutableSortedListOfRangespublic IntRangesBuffer getBuffer3(CompilationBuffer compilationBuffer)
ImmutableSortedListOfRangescompilationBuffer that is compatible with this list's
storage implementation.getBuffer3 in interface ImmutableSortedListOfRangespublic IntRangesBuffer 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 CodePointSet createInverse()
ImmutableSortedListOfRangesSortedListOfRanges.getMinValue() SortedListOfRanges.getMaxValue()]
not contained in this list.createInverse in interface ImmutableSortedListOfRangespublic static CodePointSet createInverse(SortedListOfRanges src)
public boolean inverseIsSameHighByte16Bit()
true iff not all values of this range set - interpreted as 16-bit values -
have the same high byte, but that would be the case in the inverse of this range set.public int compareTo(CodePointSet o)
compareTo in interface Comparable<CodePointSet>public int numberOf16BitRanges()
char / 16-bit values.
This interpretation is valid iff the set contains either none or all code points above
Character.MAX_VALUE.public JsonValue toJson()
toJson in interface JsonConvertiblepublic String dumpRaw()
public char[] inverseToCharArray()