public abstract class AbstractOption extends Object implements Option
Modifier and Type | Field and Description |
---|---|
protected char |
cliChar
Command line interface text of this option.
|
static char[] |
illegalNameCharacters
Array of characters not valid to use in option names.
|
protected String |
name
Name of this option.
|
protected String |
purpose
Text of the purpose of this option.
|
Constructor and Description |
---|
AbstractOption(String name,
char cliChar,
String purpose)
Creates a new instance of an abstract option given its class name,
command line interface text and its purpose.
|
Modifier and Type | Method and Description |
---|---|
Option |
copy()
Gets a copy of this option
|
char |
getCLIChar()
Gets the Command Line Interface text of this option
|
String |
getName()
Gets the name of this option
|
String |
getPurpose()
Gets the purpose of this option
|
String |
getStateString()
Gets the state of this option in human readable form
|
static boolean |
nameIsLegal(String optionName)
Gets whether the name is valid or not.
|
void |
resetToDefault()
Resets this option to the default value
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDefaultCLIString, getValueAsCLIString, setValueViaCLIString
public static final char[] illegalNameCharacters
protected String name
protected char cliChar
protected String purpose
public AbstractOption(String name, char cliChar, String purpose)
name
- the name of this optioncliChar
- the command line interface textpurpose
- the text describing the purpose of this optionpublic static boolean nameIsLegal(String optionName)
optionName
- the name of the optionpublic String getName()
Option
public char getCLIChar()
Option
getCLIChar
in interface Option
public String getPurpose()
Option
getPurpose
in interface Option
public void resetToDefault()
Option
resetToDefault
in interface Option
public String getStateString()
Option
getStateString
in interface Option
Copyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.