public class LvgCmdApi extends SystemOption
All LVG API consists methods for three phases:
History:
Modifier and Type | Field and Description |
---|---|
protected int |
catFieldNum_ |
protected java.util.Vector<java.lang.String> |
flowStrs_ |
protected java.util.Vector<java.util.Vector<java.lang.String>> |
flowStrsList_ |
protected int |
inflFieldNum_ |
protected java.io.BufferedReader |
inReader_ |
protected boolean |
promptFlag_ |
protected java.util.Vector<java.lang.String> |
quitStrList_ |
protected boolean |
runFlag_ |
protected int |
termFieldNum_ |
systemOption_
Constructor and Description |
---|
LvgCmdApi()
Creates an LvgCmdApi object and initiate related data (default).
|
LvgCmdApi(java.util.Hashtable<java.lang.String,java.lang.String> properties)
Creates an LvgCmdApi object and initiate related data with
properties to be overwritten in configuration.
|
LvgCmdApi(java.lang.String optionStr)
Creates an LvgApi object, initiate related data, using a command string.
|
LvgCmdApi(java.lang.String optionStr,
java.util.Hashtable<java.lang.String,java.lang.String> properties)
Creates an LvgApi object, initiate related data, using a command string
with properties to be overwritten in configuration.
|
LvgCmdApi(java.lang.String optionStr,
java.lang.String configFile)
Creates an LvgApi object, initiate related data, using a command string
and the path of configuration file.
|
LvgCmdApi(java.lang.String optionStr,
java.lang.String configFile,
java.util.Hashtable<java.lang.String,java.lang.String> properties)
Creates an LvgApi object, initiate related data, using a command string
and the path of configuration file with properties to be overwritten
in configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
CleanUp()
Close Lvg database connection and persistent tries.
|
protected void |
DefineFlag()
Define the Lvg system option by defining a string.
|
protected void |
ExecuteCommand(OptionItem optionItem,
Option systemOption,
Out out)
Execute Lvg command for a specified option item in a given system option.
|
protected java.util.Vector<LexItem> |
ExecuteFlow(LexItem in,
java.lang.String flowStr)
Execute a specified Lvg flow transformation for a given LexItem.
|
Configuration |
GetConfiguration()
A method to get the configuration object
|
java.sql.Connection |
GetConnection()
Get the Db connection
|
LvgFlowSpecificOption |
GetFlowSpecificOptions()
Get Lvg Flow Specific Options
|
LvgOutputOption |
GetLvgOutputOption()
Get Lvg Output Option.
|
protected void |
GetPrompt()
Get the Lvg interface prompt and print it out to system output.
|
boolean |
GetRunFlag()
Return the boolean run flag
|
boolean |
IsLegalOption()
Check if the input command is legal.
|
void |
Mutate(java.lang.String inTerm)
Performs flow mutation by processing the input term.
|
java.lang.String |
MutateToString(java.lang.String inTerm)
Performs flow mutation by processing the input term and return the result
as a string.
|
void |
PrintLvgHelp()
Print out the Lvg help menu.
|
boolean |
ProcessLine()
Performs flow mutation by processing the input line (term).
|
void |
SetMinTermLength(int minTermLength)
Set minimum Trie Length
|
void |
SetOption(java.lang.String optionStr)
Set the Lvg command for flows.
|
void |
SetPromptStr(java.lang.String promptStr)
Set the prompt string.
|
void |
SetQuitStrList(java.util.Vector<java.lang.String> quitStrList)
Set a list for quiting the program while using Lvg prompt interface.
|
CheckOption, CheckSyntax, ExecuteCommands, GetOption, ToBoolean, ToFloatArray, ToIntArray, ToStringArray
protected java.util.Vector<java.lang.String> quitStrList_
protected boolean runFlag_
protected java.io.BufferedReader inReader_
protected java.util.Vector<java.lang.String> flowStrs_
protected java.util.Vector<java.util.Vector<java.lang.String>> flowStrsList_
protected int termFieldNum_
protected int catFieldNum_
protected int inflFieldNum_
protected boolean promptFlag_
public LvgCmdApi()
CleanUp( ) method must be called to close Db connection after using this object
public LvgCmdApi(java.lang.String optionStr)
CleanUp( ) method must be called to close Db connection after using this object
optionStr
- the initial lvg option stringpublic LvgCmdApi(java.lang.String optionStr, java.lang.String configFile)
CleanUp( ) method must be called to close Db connection after using this object
optionStr
- the initial lvg option stringconfigFile
- the absolute path of the configuration filepublic LvgCmdApi(java.util.Hashtable<java.lang.String,java.lang.String> properties)
CleanUp( ) method must be called to close Db connection after using this object
properties
- properties to be overwrite in configurationpublic LvgCmdApi(java.lang.String optionStr, java.util.Hashtable<java.lang.String,java.lang.String> properties)
CleanUp( ) method must be called to close Db connection after using this object
optionStr
- the initial lvg option stringproperties
- properties to be overwrite in configurationpublic LvgCmdApi(java.lang.String optionStr, java.lang.String configFile, java.util.Hashtable<java.lang.String,java.lang.String> properties)
CleanUp( ) method must be called to close Db connection after using this object
optionStr
- the initial lvg option stringconfigFile
- the absolute path of the configuration fileproperties
- properties to be overwrite in configurationpublic void SetPromptStr(java.lang.String promptStr)
promptStr
- the customerized prompt stringpublic void SetQuitStrList(java.util.Vector<java.lang.String> quitStrList)
quitStrList
- A Vector of String - quiting programpublic boolean IsLegalOption()
public void SetOption(java.lang.String optionStr)
optionStr
- Lvg command for flowspublic LvgOutputOption GetLvgOutputOption()
public Configuration GetConfiguration()
public java.sql.Connection GetConnection()
public void CleanUp()
public boolean ProcessLine() throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
- if exception caught in DBjava.io.IOException
- if exception caught in IOpublic boolean GetRunFlag()
public void PrintLvgHelp()
public void Mutate(java.lang.String inTerm) throws java.lang.Exception
inTerm
- the term to be mutated.java.lang.Exception
- if exception caughtpublic java.lang.String MutateToString(java.lang.String inTerm) throws java.lang.Exception
inTerm
- the term to be mutated.java.lang.Exception
- if exception caughtpublic LvgFlowSpecificOption GetFlowSpecificOptions()
public void SetMinTermLength(int minTermLength)
minTermLength
- minimum trie term lengthprotected void ExecuteCommand(OptionItem optionItem, Option systemOption, Out out)
ExecuteCommand
in class SystemOption
optionItem
- the option to be executedsystemOption
- the system option that the option item will be
run onprotected void DefineFlag()
DefineFlag
in class SystemOption
protected void GetPrompt() throws java.io.IOException
java.io.IOException
- if exception caught in IOprotected java.util.Vector<LexItem> ExecuteFlow(LexItem in, java.lang.String flowStr) throws java.sql.SQLException
Notes This function needs to be modified if adding a new flow option.
in
- the LexItem to be transformedflowStr
- the specified flow in a string formatjava.sql.SQLException
- if exception caught in DB