Class ImmutableSortedListOfIntRanges
java.lang.Object
com.oracle.truffle.regex.charset.ImmutableSortedListOfIntRanges
- All Implemented Interfaces:
CharacterSet,ImmutableSortedListOfRanges,SortedListOfRanges,Iterable<Range>
- Direct Known Subclasses:
CodePointSet
public abstract class ImmutableSortedListOfIntRanges
extends Object
implements ImmutableSortedListOfRanges
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.oracle.truffle.regex.charset.ImmutableSortedListOfRanges
ImmutableSortedListOfRanges.ImmutableSortedListOfRangesIterator, ImmutableSortedListOfRanges.IntersectAndSubtractResult<T extends ImmutableSortedListOfRanges> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendRangesTo(RangesBuffer buffer, int startIndex, int endIndex) Append all ranges fromstartIndex(inclusive) toendIndex(exclusive) to the givenbuffer.protected static int[]createInverseArray(SortedListOfRanges src, Encodings.Encoding encoding) Creates a new buffer that is compatible with this list's storage implementation.getBuffer1(CompilationBuffer compilationBuffer) Returns a buffer from the givencompilationBufferthat is compatible with this list's storage implementation.getBuffer2(CompilationBuffer compilationBuffer) Returns a buffer from the givencompilationBufferthat is compatible with this list's storage implementation.getBuffer3(CompilationBuffer compilationBuffer) Returns a buffer from the givencompilationBufferthat is compatible with this list's storage implementation.intgetHi(int i) Returns the inclusive upper bound of the range stored at indexi.intgetLo(int i) Returns the inclusive lower bound of the range stored at indexi.booleaninverseIsSameHighByte(Encodings.Encoding encoding) Returnstrueiff not all values of this range set have the same high byte, but that would be the case in the inverse of this range set.protected static booleanrangesEqual(int[] a, int[] b, int length) intsize()Returns the number of disjoint ranges contained in this list.abstract int[]toArray()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.truffle.regex.charset.ImmutableSortedListOfRanges
create, createEmpty, createIntersection, createIntersection, createIntersectionSingleRange, createInverse, equalsBuffer, intersectAndSubtract, iterator, subtract, subtract, subtract, union, union, unionMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface com.oracle.truffle.regex.charset.SortedListOfRanges
addRangeTo, adjacent, adjacent, binarySearch, binarySearchExactMatch, binarySearchExactMatch, binarySearchGetFirstIntersecting, binarySearchGetFirstIntersecting, binarySearchGetFirstIntersectingOrAdjacent, binarySearchGetFirstIntersectingOrAdjacent, binarySearchNoIntersectingFound, containedBy, contains, contains, contains, contains, defaultToString, equal, equal, equalsListOfRanges, getMax, getMin, intersects, intersects, intersects, inverseGetMax, inverseGetMin, inverseRangesToString, inverseValueCount, isEmpty, isSingle, leftOf, leftOf, matches2CharsWith1BitDifference, matchesEverything, matchesMinAndMax, matchesNothing, matchesSingleAscii, matchesSingleChar, matchesSomething, rangesAreSortedAndDisjoint, rangesAreSortedNonAdjacentAndDisjoint, rangesToString, rightOf, rightOf, size, sizeOfInverse, valueCount, valueCountEquals, valueCountMax
-
Field Details
-
ranges
protected final int[] ranges
-
-
Constructor Details
-
ImmutableSortedListOfIntRanges
protected ImmutableSortedListOfIntRanges(int[] ranges)
-
-
Method Details
-
getLo
public int getLo(int i) Description copied from interface:SortedListOfRangesReturns the inclusive lower bound of the range stored at indexi.- Specified by:
getLoin interfaceSortedListOfRanges
-
getHi
public int getHi(int i) Description copied from interface:SortedListOfRangesReturns the inclusive upper bound of the range stored at indexi.- Specified by:
getHiin interfaceSortedListOfRanges
-
size
public int size()Description copied from interface:SortedListOfRangesReturns the number of disjoint ranges contained in this list.- Specified by:
sizein interfaceSortedListOfRanges
-
getBuffer1
Description copied from interface:ImmutableSortedListOfRangesReturns a buffer from the givencompilationBufferthat is compatible with this list's storage implementation.- Specified by:
getBuffer1in interfaceImmutableSortedListOfRanges
-
getBuffer2
Description copied from interface:ImmutableSortedListOfRangesReturns a buffer from the givencompilationBufferthat is compatible with this list's storage implementation.- Specified by:
getBuffer2in interfaceImmutableSortedListOfRanges
-
getBuffer3
Description copied from interface:ImmutableSortedListOfRangesReturns a buffer from the givencompilationBufferthat is compatible with this list's storage implementation.- Specified by:
getBuffer3in interfaceImmutableSortedListOfRanges
-
createTempBuffer
Description copied from interface:ImmutableSortedListOfRangesCreates a new buffer that is compatible with this list's storage implementation.- Specified by:
createTempBufferin interfaceImmutableSortedListOfRanges
-
appendRangesTo
Description copied from interface:SortedListOfRangesAppend all ranges fromstartIndex(inclusive) toendIndex(exclusive) to the givenbuffer. The caller is responsible for not violating the target buffer's sortedness; This effectively means that the range atstartIndexmust berightOfthe buffer's last range.- Specified by:
appendRangesToin interfaceSortedListOfRanges
-
toArray
public abstract int[] toArray() -
inverseIsSameHighByte
Returnstrueiff not all values of this range set have the same high byte, but that would be the case in the inverse of this range set. -
createInverseArray
-
toString
-
rangesEqual
protected static boolean rangesEqual(int[] a, int[] b, int length)
-