public class GroupBoundaries extends Object implements JsonConvertible
NFAStateTransition or ASTTransition. The boundaries of one capture group
correspond to its opening and closing brackets. All capture group boundaries are mapped to
indices according to Group.getBoundaryIndexStart() and
Group.getBoundaryIndexEnd(). A transition may update or clear any
boundary when traversed. RegexAST. Due to the deduplication, every
instance must be treated as immutable!ASTTransition,
NFAStateTransition,
RegexAST| Modifier and Type | Method and Description |
|---|---|
void |
apply(int[] array,
int offset,
int index) |
void |
applyExploded(int[] array,
int offset,
int index) |
void |
applyToResultFactory(PreCalculatedResultFactory resultFactory,
int index)
Updates a resultFactory in respect to a single transition and index.
|
byte[] |
clearsToByteArray() |
boolean |
equals(Object obj) |
CompilationFinalBitSet |
getClearIndices()
Directly returns the
CompilationFinalBitSet used to store the indices of all capture
group boundaries that should be cleared when traversed. |
static GroupBoundaries |
getEmptyInstance() |
static GroupBoundaries |
getStaticInstance(CompilationFinalBitSet updateIndices,
CompilationFinalBitSet clearIndices)
Used for deduplication of very common instances of this class.
|
CompilationFinalBitSet |
getUpdateIndices()
Directly returns the
CompilationFinalBitSet used to store the indices of all capture
group boundaries that should be updated when traversed. |
int |
hashCode() |
boolean |
hasIndexClears() |
boolean |
hasIndexUpdates() |
JsonArray |
indexUpdateSourceSectionsToJson(RegexAST ast) |
boolean |
isEmpty() |
void |
materializeArrays() |
JsonValue |
toJson() |
String |
toString() |
void |
updateBitSets(CompilationFinalBitSet foreignUpdateIndices,
CompilationFinalBitSet foreignClearIndices)
Updates the given
CompilationFinalBitSets with the values contained in this
GroupBoundaries object. |
byte[] |
updatesToByteArray() |
public static GroupBoundaries getStaticInstance(CompilationFinalBitSet updateIndices, CompilationFinalBitSet clearIndices)
public static GroupBoundaries getEmptyInstance()
public boolean isEmpty()
public byte[] updatesToByteArray()
public byte[] clearsToByteArray()
public void materializeArrays()
public CompilationFinalBitSet getUpdateIndices()
CompilationFinalBitSet used to store the indices of all capture
group boundaries that should be updated when traversed. public CompilationFinalBitSet getClearIndices()
CompilationFinalBitSet used to store the indices of all capture
group boundaries that should be cleared when traversed. public boolean hasIndexUpdates()
public boolean hasIndexClears()
public void updateBitSets(CompilationFinalBitSet foreignUpdateIndices, CompilationFinalBitSet foreignClearIndices)
CompilationFinalBitSets with the values contained in this
GroupBoundaries object.public void applyToResultFactory(PreCalculatedResultFactory resultFactory, int index)
resultFactory - the resultFactory to update.index - current index. All group boundaries contained in this object will be set to this
value in the resultFactory.public void applyExploded(int[] array,
int offset,
int index)
public void apply(int[] array,
int offset,
int index)
public JsonValue toJson()
toJson in interface JsonConvertible