stella
Interface ParameterClustering

All Superinterfaces:
DriverDepending, PropertySupplying, TargetDepending
All Known Implementing Classes:
AbstractParameterCluster, ParameterSet

public interface ParameterClustering
extends PropertySupplying, DriverDepending, TargetDepending

A generic interface for querying and manipulating global parameters. Each parameter served by this parameter watching instance must be wrapped into a Parameter. All initialization must already occur during the construction phase of the appropriate object.

As some parameters may refer to astrometric target properties, a TargetDefinition can be registered at the paramter set with #setTarget.


Field Summary
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Method Summary
 void addParameter(Parameter add)
          Adds a parameter to the parameter watching instance.
 Map<String,Object> change(Map<String,Object> all)
          Sets multiple parameter values.
 Object get(String name)
          Gets the value of the parameter, regardless of type.
 Set<String> getAllParameterNames()
          Returns a set of all global parameter names served by this parameter watcher.
 Collection<Parameter> getAllParameters()
          Returns a collection of all global parameters served by this parameter watcher.
 ErrorEvent getError()
          Retrieves the last error event set to the cluster's parameters.
 Parameter getParameter(String name)
          Gets a global parameter by its name, returns null if undefined.
 TargetDefinition getTarget()
          Gets the target currently assigned to this parameter watching instance.
 Boolean getTrigger(String name)
          Returns the boolean of a specified Trigger instance.
 Number getValue(String name)
          Returns the value of a specified global parameter.
 WeatherSurveying getWeatherSurveyor()
          Returns the weather surveyor currently assigned to this parameter cluster.
 Parameter removeParameter(String name)
          Removes a paramter from the parameter watching instance.
 Object set(String name, Object val)
          Sets the value of the parameter, regardless of type.
 void setCommandLauncher(CommandLaunching[] launch)
          Registers a command launcher for StatusRequesting parameters.
 void setError(ErrorEvent ee)
          Registers an error event to the cluster's ErrorDependingParameters.
 Boolean setTrigger(String name, Boolean newval)
          Tries to set a trigger parameter identified with its name.
 Number setValue(String name, Number newval)
          Tries to set a global parameter.
 void setWeatherSurveyor(WeatherSurveying weather)
          Registers a weather surveying instance to this parameter cluster.
 Boolean toggleTrigger(String name)
          Toggles a trigger given by its name.
 
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
 
Methods inherited from interface io.DriverDepending
registerDriver
 
Methods inherited from interface stella.TargetDepending
registerTarget
 

Method Detail

setCommandLauncher

void setCommandLauncher(CommandLaunching[] launch)
Registers a command launcher for StatusRequesting parameters. This is usually done after initialization of the parameter cluster.


setWeatherSurveyor

void setWeatherSurveyor(WeatherSurveying weather)
Registers a weather surveying instance to this parameter cluster. Parameters that are instances of SensorValue should register as data event listeners at the required sensor.


getWeatherSurveyor

WeatherSurveying getWeatherSurveyor()
Returns the weather surveyor currently assigned to this parameter cluster.


getTarget

TargetDefinition getTarget()
Gets the target currently assigned to this parameter watching instance.


setError

void setError(ErrorEvent ee)
Registers an error event to the cluster's ErrorDependingParameters.


getError

ErrorEvent getError()
Retrieves the last error event set to the cluster's parameters.


getParameter

Parameter getParameter(String name)
Gets a global parameter by its name, returns null if undefined.


getAllParameters

Collection<Parameter> getAllParameters()
Returns a collection of all global parameters served by this parameter watcher. The returned collection consists of objects of Parameters.


getAllParameterNames

Set<String> getAllParameterNames()
Returns a set of all global parameter names served by this parameter watcher. Only reference to the names are returned.


get

Object get(String name)
Gets the value of the parameter, regardless of type.


set

Object set(String name,
           Object val)
Sets the value of the parameter, regardless of type.


change

Map<String,Object> change(Map<String,Object> all)
Sets multiple parameter values. The argument map is treated such that its keys are matched to parameter names, their mapping values are directly passed to the parameters Parameter.set(java.lang.Object) method.

Returns:
A map with values equivalent to the old parameter values.

getValue

Number getValue(String name)
Returns the value of a specified global parameter. The parameter is identified with its name. The underlying parameter instance must be of type Value, otherwise null is returned.


setValue

Number setValue(String name,
                Number newval)
Tries to set a global parameter. The parameter is identified with its name. This method can result in an UnsupportedOperationException to be thrown.


getTrigger

Boolean getTrigger(String name)
Returns the boolean of a specified Trigger instance. The trigger is identified with its name.The underlying parameter instance must be of type Trigger, otherwise null is returned.


setTrigger

Boolean setTrigger(String name,
                   Boolean newval)
Tries to set a trigger parameter identified with its name. This method can result in an UnsupportedOperationException to be thrown.


toggleTrigger

Boolean toggleTrigger(String name)
Toggles a trigger given by its name. Returns the new trigger value. This method can result in an UnsupportedOperationException to be thrown.


addParameter

void addParameter(Parameter add)
Adds a parameter to the parameter watching instance. Useful for parameters like device triggers that require a very special setup and cannot be constructed from a properties set.
Any parameter that is added must spawn a search for other parameters that need it as an adiitional info.


removeParameter

Parameter removeParameter(String name)
Removes a paramter from the parameter watching instance. The parameter to remove is qualified by its name.

Returns:
The removed parameter or null if not served.