Class PreCalculatedResultFactory
java.lang.Object
com.oracle.truffle.regex.result.PreCalculatedResultFactory
- All Implemented Interfaces:
JsonConvertible
Predefined lists of capture group start and end indices. Used for regular expressions like
/(\w)(\d)/
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearIndices(TBitSet clearIndices) copy()int[]createArrayFromEnd(int end) createFromEnd(int end) createFromStart(int start) booleanintgetEnd(int groupNr) intOutermost bounds of the result, necessary for expressions where lookaround matches may exceed the bounds of capture group 0.intgetStart(int groupNr) inthashCode()voidsetEnd(int groupNr, int value) voidsetLastGroup(int lastGroup) voidsetLength(int length) voidsetStart(int groupNr, int value) toJson()voidupdateIndices(TBitSet updateIndices, int index)
-
Constructor Details
-
PreCalculatedResultFactory
public PreCalculatedResultFactory(int nGroups, boolean trackLastGroup)
-
-
Method Details
-
copy
-
getStart
public int getStart(int groupNr) -
setStart
public void setStart(int groupNr, int value) -
getEnd
public int getEnd(int groupNr) -
setEnd
public void setEnd(int groupNr, int value) -
getLength
public int getLength()Outermost bounds of the result, necessary for expressions where lookaround matches may exceed the bounds of capture group 0. -
setLength
public void setLength(int length) -
setLastGroup
public void setLastGroup(int lastGroup) -
updateIndices
-
clearIndices
-
createFromStart
-
createFromEnd
-
createArrayFromEnd
public int[] createArrayFromEnd(int end) -
hashCode
-
equals
-
toJson
- Specified by:
toJsonin interfaceJsonConvertible
-