public class Intervals<D>
extends java.lang.Object
Used to construct CharTrans
objects of different implementations.
Modifier and Type | Field and Description |
---|---|
static long[] |
stats |
Constructor and Description |
---|
Intervals() |
Modifier and Type | Method and Description |
---|---|
void |
complete(D o)
all intervals which are currently mapped to
null
will be mapped to the given object. |
D |
getAt(int i) |
char |
getFirstAt(int i) |
char |
getLastAt(int i) |
void |
invert(D o)
inverts the mapped and unmapped intervals.
|
static java.lang.String |
logStats() |
void |
overwrite(char first,
char last,
D o) |
void |
reset()
reset to the state of a freshly constructed object.
|
static void |
resetStats() |
void |
setAt(int i,
D o) |
int |
size() |
int |
split(char ch)
Split whichever interval covers ch at ch and return the position
of the left interval.
|
java.lang.String |
toString() |
public static java.lang.String logStats()
public static void resetStats()
public final void complete(D o)
all intervals which are currently mapped to null
will be mapped to the given object.
public final void reset()
char
values being mapped to null
.public final int size()
public final D getAt(int i)
public final void setAt(int i, D o)
public final char getFirstAt(int i)
public final char getLastAt(int i)
public final int split(char ch)
Split whichever interval covers ch at ch and return the position of the left interval. The value stored in the interval to split will be put in both parts.
public final void overwrite(char first, char last, D o)
public final void invert(D o)
inverts the mapped and unmapped intervals. Intervals which are
currently mapped to null
will be mapped to
o
, and
those currently mapped to some object are mapped to
null
.
public java.lang.String toString()
toString
in class java.lang.Object