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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDefaultCLIString, getValueAsCLIString, setValueViaCLIString
measureByteSize
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
public Option copy()
MOAObject
public void getDescription(StringBuilder sb, int indent)
MOAObject
AbstractMOAObject.toString
to give a string representation of the object.getDescription
in interface MOAObject
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indentpublic JComponent getEditComponent()
Option
getEditComponent
in interface Option
Copyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.