stella.parameter
Class PilarValue
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.AbstractCachedParameter
stella.parameter.PilarParameter
stella.parameter.PilarValue
- All Implemented Interfaces:
- DriverDepending, Cloneable, Parameter, Value, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying
public class PilarValue
- extends PilarParameter
- implements Value
Telescope parameters whose string representation can be parsed into a number
|
Method Summary |
Number |
getValue()
Gets the pilar response either from the cache or from the underlying
telescope and trie to parse it into a Number. |
void |
init()
On init, try to load our parser class. |
private boolean |
initParserClass()
We try to use the parser class for converting string answers from the
pilar driver to number instances. |
double |
rescanned(String key,
String old,
String newval)
If the parser class changed, we try to rebuild it. |
Number |
setValue(Number to)
Setting a number is not allowed. |
| Methods inherited from class stella.parameter.AbstractParameter |
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString |
| Methods inherited from class util.PropertyResources |
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from interface util.PropertySupplying |
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
KEY_VALUECLASS
public static final String KEY_VALUECLASS
- The name of number class used to parse the parameter from.
- See Also:
- Constant Field Values
DEFVALUECLASS
private static final String DEFVALUECLASS
- Default value class is Double.
- See Also:
- Constant Field Values
number
private Class<? extends Number> number
- We use this class for parsing strings to numbers.
PilarValue
public PilarValue(Map<String,String> prop)
- Constructs a new pilar value from the properties.
init
public void init()
- On init, try to load our parser class.
- Specified by:
init in interface Initializable- Overrides:
init in class AbstractParameter
initParserClass
private boolean initParserClass()
- We try to use the parser class for converting string answers from the
pilar driver to number instances. Defaults to Double class.
- Returns:
- True, if the class was found and is usable.
rescanned
public double rescanned(String key,
String old,
String newval)
- If the parser class changed, we try to rebuild it.
- Specified by:
rescanned in interface Reloadable- Overrides:
rescanned in class PilarParameter
getValue
public Number getValue()
- Gets the pilar response either from the cache or from the underlying
telescope and trie to parse it into a Number. The number class can
be specified in the properties.
- Specified by:
getValue in interface Value
setValue
public Number setValue(Number to)
- Setting a number is not allowed. This is done only within certain
commands of a
PilarDriver
- Specified by:
setValue in interface Value