Package monq.jfa
Interface CharTrans<T>
- All Superinterfaces:
Iterable<RangeEntry<T>>
- All Known Implementing Classes:
EmptyCharTrans
Interface of a data structure to map non-overlapping character ranges
like 'a'-'f' to non-null objects. Since the character ranges are naturally sorted, a
CharTrans object acts like an array for the stored object with a size() and
access method getAt() to retrieve an object stored at a given index.
CharTrans objects should be immutable. To assemble
them, use Intervals.
-
Method Summary
Modifier and TypeMethodDescriptionget(char ch) returns the object stored in the transition table map for characterchornullifchis not mapped.getAt(int pos) returns the object stored at index positionpos.chargetFirstAt(int pos) returns the left boundary of the range stored at indexposchargetLastAt(int pos) returns the right boundary of the range stored at indexposdefault booleanisEmpty()Returnstrueif no character is mapped.default Iterator<RangeEntry<T>> iterator()intsize()returns the number of character ranges (and objects) stored.static <T> StringMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
get
returns the object stored in the transition table map for character
chornullifchis not mapped. -
size
int size()returns the number of character ranges (and objects) stored. -
isEmpty
default boolean isEmpty()Returnstrueif no character is mapped. -
getAt
returns the object stored at index positionpos. -
getFirstAt
char getFirstAt(int pos) returns the left boundary of the range stored at indexpos -
getLastAt
char getLastAt(int pos) returns the right boundary of the range stored at indexpos -
toString
-
iterator
-