public class SenseKeyParser extends Object implements ILineParser<ISenseKey>
A parser that takes a sense key string and produces an ISenseKey
object.
This class follows a singleton design pattern, and is not intended to be
instantiated directly; rather, call the getInstance() method to get
the singleton instance.
ILineParser.MisformattedLineException| Modifier | Constructor and Description |
|---|---|
protected |
SenseKeyParser()
This constructor is marked protected so that the class may be
sub-classed, but not directly instantiated.
|
| Modifier and Type | Method and Description |
|---|---|
static SenseKeyParser |
getInstance()
Returns the singleton instance of this class, instantiating it if
necessary.
|
ISenseKey |
parseLine(String key)
Given the line of data, this method produces an object of class
T. |
protected ILexFile |
resolveLexicalFile(int lexFileNum)
Retrieves the lexical file objects for the
parseLine(String)
method. |
protected SenseKeyParser()
getInstance() method.public static SenseKeyParser getInstance()
null.null singleton instance of this class,
instantiating it if necessary.public ISenseKey parseLine(String key)
ILineParserT.parseLine in interface ILineParser<ISenseKey>key - the line to be parsedprotected ILexFile resolveLexicalFile(int lexFileNum)
Retrieves the lexical file objects for the parseLine(String)
method. If the lexical file number does correspond to a known lexical
file, the method returns a singleton placeholder 'unknown' lexical file
object.
This is implemented in its own method for ease of subclassing.
lexFileNum - the number of the lexical file to returnCopyright © 2018. All rights reserved.