|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cdx.scorebot.util.config.ConfigOption<T>
public abstract class ConfigOption<T>
Declares translation methods a parameter must have so it can be translated between a form representable on the Configurer GUI and a form useful to the Test itself. This allows new parameter types to be added without changing how the GUI works or what it needs to do to get parameter values for the Test. This also allows for the type of component in the GUI and a selection of valid values to be specified.
Field Summary | |
---|---|
protected java.util.Vector<T> |
possValues
the valid values for the option (this is empty if the ComponType is either ANY or BINARY). |
Constructor Summary | |
---|---|
ConfigOption(T option)
Instantiates a ConfigOption with no restricted values (unless the option is a Boolean, in which case the ComponType is BINARY else ANY). |
|
ConfigOption(T option,
T[] possValues)
Instantiates a ConfigOption with specified allowed values. |
Method Summary | |
---|---|
void |
addValue(T t)
Adds a value which this variable can take on. |
boolean |
equals(ConfigOption o)
|
abstract java.util.Vector<T> |
getAllowedValuesCopy()
gets a COPY of the possible values this component may take on (these values are only used if ComponType is MULTI or BINARY). |
ComponType |
getComponType()
gets the kind of support a component the GUI should use to display the option |
T |
getCurrentValue()
gets the currently selected option's value |
int |
getCurrentValueIndex()
gets the currently selected option's index in the values vector |
java.lang.String |
getName()
gets the name of the option, if set |
abstract ConfigOption |
getShortCopy()
Returns a copy of this configuration option. |
java.lang.String |
getType()
gets the name of the type that this ConfigOption holds (class name only - no package qualification) |
T |
getValue(int index)
Gets the specified value which this variable can take on. |
java.util.Vector<T> |
getValues()
gets the values this variable may be |
VariableType |
getVarianceType()
gets how this option varies in value |
void |
nextValue()
Chooses the "next" value as specified by the VariableType varianceType |
void |
removeValue(int index)
Removes the value from the values this ConfigVariableOption can take on |
void |
setCurrentValue(T option)
sets the currently selected value to this new value |
void |
setName(java.lang.String name)
sets the name of the option |
void |
setVarianceType(VariableType type)
sets how this option varies in value |
java.lang.String |
toString()
returns the name of the config option |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final java.util.Vector<T> possValues
Constructor Detail |
---|
public ConfigOption(T option)
option
- initial value of the optionpublic ConfigOption(T option, T[] possValues)
option
- initial value of the optionpossValues
- what kind of values a component will need to work with for this optionMethod Detail |
---|
public boolean equals(ConfigOption o)
public abstract java.util.Vector<T> getAllowedValuesCopy()
public abstract ConfigOption getShortCopy()
public void nextValue()
public VariableType getVarianceType()
public void setVarianceType(VariableType type)
public ComponType getComponType()
public final java.lang.String getType()
public T getCurrentValue()
public void setCurrentValue(T option)
public void addValue(T t)
t
- the value to add to this ConfigVariableOption's valuespublic int getCurrentValueIndex()
public T getValue(int index) throws java.lang.ArrayIndexOutOfBoundsException
index
- remove the value at the specified index.
java.lang.ArrayIndexOutOfBoundsException
- if the index was invalid.public java.util.Vector<T> getValues()
public void removeValue(int index) throws java.lang.ArrayIndexOutOfBoundsException
index
- remove the value at the specified index.
java.lang.ArrayIndexOutOfBoundsException
- if the index was invalid.public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |