|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdk.brics.automaton.RunAutomaton
dk.brics.automaton.CustomRunAutomaton
public class CustomRunAutomaton
Finite-state automaton with fast run operation. This is a modified version of RunAutomaton from the BRICS automaton package. Modified such that regular expressions can be assigned IDs that are used to differentiate joined automatons.
| Field Summary | |
|---|---|
static char |
delimiter
This delimiter char is used to separate regular expressions from their IDs. |
private static long |
serialVersionUID
|
| Fields inherited from class dk.brics.automaton.RunAutomaton |
|---|
accept, classmap, initial, points, size, transitions |
| Constructor Summary | |
|---|---|
CustomRunAutomaton(dk.brics.automaton.Automaton a,
boolean tableize)
Constructs a new RunAutomaton from a deterministic
Automaton. |
|
| Method Summary | |
|---|---|
java.util.ArrayList<java.lang.Character> |
getValidChars(int state)
|
boolean |
isAcceptDelimited(int state,
char delimiter)
|
static CustomRunAutomaton |
load(java.io.InputStream stream)
Retrieves a serialized RunAutomaton from a stream. |
static CustomRunAutomaton |
load(java.net.URL url)
Retrieves a serialized RunAutomaton located by a URL. |
CustomAutomatonMatcher |
newCustomMatcher(java.lang.CharSequence s)
Creates a new automaton matcher for the given input. |
CustomAutomatonMatcher |
newCustomMatcher(java.lang.CharSequence s,
int startOffset,
int endOffset)
Creates a new automaton matcher for the given input. |
| Methods inherited from class dk.brics.automaton.RunAutomaton |
|---|
getCharClass, getCharIntervals, getInitialState, getSize, isAccept, newMatcher, newMatcher, run, run, setAlphabet, step, store, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
public static final char delimiter
| Constructor Detail |
|---|
public CustomRunAutomaton(dk.brics.automaton.Automaton a,
boolean tableize)
RunAutomaton from a deterministic
Automaton. If the given automaton is not deterministic,
it is determinized first.
a - an automatontableize - if true, a transition table is created which makes the run
method faster in return of a higher memory usage| Method Detail |
|---|
public java.util.ArrayList<java.lang.Character> getValidChars(int state)
public static CustomRunAutomaton load(java.net.URL url)
throws java.io.IOException,
java.io.OptionalDataException,
java.lang.ClassCastException,
java.lang.ClassNotFoundException,
java.io.InvalidClassException
RunAutomaton located by a URL.
url - URL of serialized automaton
java.io.IOException - if input/output related exception occurs
java.io.OptionalDataException - if the data is not a serialized object
java.io.InvalidClassException - if the class serial number does not match
java.lang.ClassCastException - if the data is not a serialized RunAutomaton
java.lang.ClassNotFoundException - if the class of the serialized object cannot be found
public static CustomRunAutomaton load(java.io.InputStream stream)
throws java.io.IOException,
java.io.OptionalDataException,
java.lang.ClassCastException,
java.lang.ClassNotFoundException,
java.io.InvalidClassException
RunAutomaton from a stream.
stream - input stream with serialized automaton
java.io.IOException - if input/output related exception occurs
java.io.OptionalDataException - if the data is not a serialized object
java.io.InvalidClassException - if the class serial number does not match
java.lang.ClassCastException - if the data is not a serialized RunAutomaton
java.lang.ClassNotFoundException - if the class of the serialized object cannot be foundpublic CustomAutomatonMatcher newCustomMatcher(java.lang.CharSequence s)
s - the CharSequence to search
public CustomAutomatonMatcher newCustomMatcher(java.lang.CharSequence s,
int startOffset,
int endOffset)
s - the CharSequence to searchstartOffset - the starting offset of the given character sequenceendOffset - the ending offset of the given character sequence
public boolean isAcceptDelimited(int state,
char delimiter)
state - delimiter -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||