public abstract class AbstractOption extends AbstractMOAObject 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()
This method produces a copy of this object.
|
char |
getCLIChar()
Gets the Command Line Interface text of this option
|
void |
getDescription(StringBuilder sb,
int indent)
Returns a string representation of this object.
|
JComponent |
getEditComponent()
Gets the GUI component to edit
|
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
|
copy, measureByteSize, measureByteSize, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDefaultCLIString, getValueAsCLIString, setValueViaCLIStringmeasureByteSizepublic 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()
Optionpublic char getCLIChar()
OptiongetCLIChar in interface Optionpublic String getPurpose()
OptiongetPurpose in interface Optionpublic void resetToDefault()
OptionresetToDefault in interface Optionpublic String getStateString()
OptiongetStateString in interface Optionpublic Option copy()
MOAObjectpublic void getDescription(StringBuilder sb, int indent)
MOAObjectAbstractMOAObject.toString
to give a string representation of the object.getDescription in interface MOAObjectsb - the stringbuilder to add the descriptionindent - the number of characters to indentpublic JComponent getEditComponent()
OptiongetEditComponent in interface OptionCopyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.