TextElementSequence
Contract for a specialized sequence of TextElements with enhanced search and modification capabilities for lexical preservation operations.
Unlike standard List, this interface provides:
- Index-based search with predicates (findFirst, findLast, findNext, findPrevious)
- Element-based search (indexOf, lastIndexOf with overloads)
- Controlled mutations (insert, remove) where caller manages index adjustments
Thread safety: Implementations are not required to be thread-safe.
Index management: Mutation operations modify the underlying list directly. Callers are responsible for tracking index changes after mutations.
Since
3.28.0
Inheritors
Functions
Link copied to clipboard
Tests whether all elements in this sequence match the given predicate.
Link copied to clipboard
Tests whether any element in this sequence matches the given predicate.
Link copied to clipboard
Finds the first index where the predicate matches, searching forward from index 0.
Link copied to clipboard
Finds the last index where the predicate matches, searching backward from the end.
Link copied to clipboard
Finds the previous index where the predicate matches, searching backward from fromIndex (inclusive).
Link copied to clipboard
Returns the element at the specified index.
Link copied to clipboard
Finds the first occurrence of the specified element.
Finds the next occurrence of element starting from fromIndex (inclusive).
Link copied to clipboard
Inserts element at the specified index.
Link copied to clipboard
Inserts all elements at the specified index.
Link copied to clipboard
Checks if the index is valid (0 <= index
Link copied to clipboard
Returns an iterator starting at index 0.
Returns an iterator starting at the specified index.
Link copied to clipboard
Finds the last occurrence of the specified element.
Finds the previous occurrence of element before fromIndex (inclusive).
Link copied to clipboard
Tests whether no elements in this sequence match the given predicate.
Link copied to clipboard
Removes elements in range [fromIndex, toIndex] (inclusive on both ends).
Link copied to clipboard
Returns a stream of elements for functional operations.
Link copied to clipboard
Returns a new list containing elements from the start until the predicate fails.
Link copied to clipboard
Returns an unmodifiable view of the underlying list.
Link copied to clipboard
Returns the underlying mutable list.