|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdict.prepare.ParserBase
public abstract class ParserBase
Base class for classes implementing parsing of diverse dictionary files.
Field Summary | |
---|---|
private static int |
BUFLEN
|
protected IDictParserHandler |
m_handler
Handler for retrieving extracted index keywords. |
private int |
m_type
The dictionary type. |
Constructor Summary | |
---|---|
ParserBase(IDictParserHandler aHandler,
int aType)
Initialises the parser for the given handler and type. |
Method Summary | |
---|---|
static ParserBase |
getInstance(IDictParserHandler aHandler,
int aType)
Returns an instance of the class handling the given type. |
protected abstract boolean |
processLine(java.lang.String s,
int fileno,
long from,
long to)
Extracts index keywords from a single dictionary or thesaurus line. |
void |
read(java.io.InputStream input,
int fileno)
Extracts index keywords from the given stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int BUFLEN
protected IDictParserHandler m_handler
private int m_type
Constructor Detail |
---|
public ParserBase(IDictParserHandler aHandler, int aType)
aHandler
- the handler for extracted index keywords.aType
- the dictionary type.Method Detail |
---|
public static final ParserBase getInstance(IDictParserHandler aHandler, int aType)
aHandler
- the handler for extracted translations,
directly passed to the constructor of the particular
class.aType
- the dictionary type, one of the constants
DictType.DICTCC, DictType.UDDL, DictType.THES.
protected abstract boolean processLine(java.lang.String s, int fileno, long from, long to)
s
- the line of thex from which to extract the index keywors.from
- position of the begin of the line in the dictionary or
thesaurus file.to
- position of the end of the line in the dictionary or
thesaurus file.fileno
- index of the dictionary file, form which the line s has
been extracted.
public final void read(java.io.InputStream input, int fileno) throws java.io.IOException
input
- the stream to read.fileno
- index of the dictionary file to read (the dictionary
consists of multiple files)
java.io.IOException
- on read errors.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |