public class Misc
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
printable(char ch)
converts a character into something which can be printed on the
console
|
static java.lang.CharSequence |
printable(java.lang.CharSequence s) |
static void |
printable(java.lang.StringBuilder out,
char ch) |
static Dfa |
wrapRoi(java.lang.CharSequence reStart,
FaAction startAction,
DfaRun.FailedMatchBehaviour inRoi,
java.lang.CharSequence reEnd,
FaAction endAction,
DfaRun.FailedMatchBehaviour outsideRoi,
Nfa client)
wraps a
Nfa into another one which defines a region
of interest (ROI). |
public static Dfa wrapRoi(java.lang.CharSequence reStart, FaAction startAction, DfaRun.FailedMatchBehaviour inRoi, java.lang.CharSequence reEnd, FaAction endAction, DfaRun.FailedMatchBehaviour outsideRoi, Nfa client) throws ReSyntaxException, CompileDfaException
wraps a Nfa
into another one which defines a region
of interest (ROI). The ROI is defined by two regular
expressions, reStart
and reEnd
. This
method creates a new Nfa
, call it envelope,
which only contains
reStart
. If reStart
is found, it switches
to the given Nfa
client
. The
client
is augmented by reEnd
such that
it switches back to the envelope when reEnd
is encountered.
Note 1: If reEnd
interferes with any regular
expressions already in client
, detection of the end
of the ROI may fail.
Note 2: The client
Nfa
is
compiled in this method and consequently cannot be used anymore
afterwards.
reStart
- is the regular expression defining the start of the
ROIstartAction
- is the action called when reStart
is found. If null
, Copy
is
assumed.inRoi
- specifies how non matching input is to be handled
within the ROIreEnd
- is the regular expression defining the end of the ROIendAction
- is the action called when reEnd
is
found. If null
, Copy
is
assumed.outsideRoi
- specifies how non matching input is to be handled
outside the ROIclient
- is the Nfa
to be wrapped.ReSyntaxException
- if reStart
or
reEnd
contain syntax errors.CompileDfaException
- if client
, after adding
reEnd
cannot be compiled.public static java.lang.String printable(char ch)
public static void printable(java.lang.StringBuilder out, char ch)
public static java.lang.CharSequence printable(java.lang.CharSequence s)