Lvg Java
2006p Version

gov.nih.nlm.nls.lvg.CmdLineSyntax
Class SystemOption

java.lang.Object
  extended by gov.nih.nlm.nls.lvg.CmdLineSyntax.SystemOption
Direct Known Subclasses:
LvgCmdApi, OptionTest

public abstract class SystemOption
extends java.lang.Object

This is an abstract class for all systems to use and setup system command line syntax. A nice feature of it is to check the syntax of the input command line.

History:

Notes: It is illegal to have multiple arguments with one of them is NONE
For example: -a:aa~aaa~aab~NONE
Instead, it should change to -a:aa~aaa~aab~none
where none is a pre-defined argument for flag -a

Version:
V-2006p
Author:
NLM NLS Development Team

Field Summary
protected  Option systemOption_
           
 
Constructor Summary
SystemOption()
          Create the system option object
 
Method Summary
protected static boolean CheckOption(OptionItem inItem, java.lang.String systemItemStr)
           
static boolean CheckSyntax(Option option, Option systemOption, boolean printRun, boolean printError)
          Check if the input option is legal according to the given system option This method can be used as syntax error checker
protected abstract  void DefineFlag()
           
protected abstract  void ExecuteCommand(OptionItem optionItem, Option systemOption)
           
 void ExecuteCommands(Option inOption, Option systemOption)
          Execute a given option in a command line system (with given system option)
 Option GetOption()
          Get the defined system option of the command line syntax system
protected  boolean ToBoolean(java.lang.String in)
           
protected  float[] ToFloatArray(java.util.Vector inList)
           
protected  int[] ToIntArray(java.util.Vector inList)
           
protected  java.lang.String[] ToStringArray(java.util.Vector inList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

systemOption_

protected Option systemOption_
Constructor Detail

SystemOption

public SystemOption()
Create the system option object

Method Detail

GetOption

public Option GetOption()
Get the defined system option of the command line syntax system

Returns:
system option

CheckSyntax

public static boolean CheckSyntax(Option option,
                                  Option systemOption,
                                  boolean printRun,
                                  boolean printError)
Check if the input option is legal according to the given system option This method can be used as syntax error checker

Parameters:
option - input option to be checked
systemOption - system option that the checking is based on
printRun - a boolean flag to print algorithm details
printError - a boolean flag to print error
Returns:
legal option or not

ExecuteCommands

public void ExecuteCommands(Option inOption,
                            Option systemOption)
Execute a given option in a command line system (with given system option)

Parameters:
inOption - option to be executed
systemOption - system option for the command line

ExecuteCommand

protected abstract void ExecuteCommand(OptionItem optionItem,
                                       Option systemOption)

DefineFlag

protected abstract void DefineFlag()

ToBoolean

protected boolean ToBoolean(java.lang.String in)

ToIntArray

protected int[] ToIntArray(java.util.Vector inList)

ToFloatArray

protected float[] ToFloatArray(java.util.Vector inList)

ToStringArray

protected java.lang.String[] ToStringArray(java.util.Vector inList)

CheckOption

protected static boolean CheckOption(OptionItem inItem,
                                     java.lang.String systemItemStr)

Lvg Java
2006p Version

Submit a bug or feature

Copyright © 2006p National Library of Medicine