public class UserShare extends AbstractValue implements ParameterDepending, Reloadable
StopWatch parameters, one giving the total observation
time of the telescope, and the second giving the time the telescope was
dedicated to the particular user group. The name of the parameter stems from
the user group it points to KEY_USERTIME, augmented with the
#SHARECURRENT appendix. The stop watch it uses for the user time is
named according to the KEY_USERTIME, augmented with
#SHAREREQUEST. Note that this parameter cannot be set, but its value
is influenced by actions on the two StopWatches it relies on. Note
also that it is in principle possible to assign not the total observation
time of the telescope but rather a different StopWatch to the user
share, using the KEY_TOTALTIME key.PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
static String |
CURRENT
The parameter name extension to define current user group total time.
|
private static String |
DEFNAME
The default name of the paramter.
|
private static String |
DEFTOTALTIME
The default name of the total time stop watch.
|
private static DecimalFormat |
df
The formatter for the user share.
|
static String |
KEY_TOTALTIME
The key to the unique trigger name.
|
static String |
KEY_USERTIME
The key to the unique trigger name.
|
static String |
REQUEST
The parameter name extension to define requested user time shares.
|
static String |
SHARE
The parameter name extension to define current user time shares.
|
private Value |
timetotal
The value counting total observation time of the telescope.
|
private StopWatch |
timeuser
The stop watch counting total observation time of a user group.
|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
UserShare(Map<String,String> info)
Constructs a new user share parameter.
|
| Modifier and Type | Method and Description |
|---|---|
Number |
getValue()
Gets the current user group share.
|
void |
registerParameter(Parameter add)
Registers an additional parameter to this parameter.
|
double |
rescanned(String key,
String old,
String newval)
As any parameter depending instance we fail if the parameter we depend on
is now a different one.
|
Number |
setValue(Number val)
Sets the current user time share.
|
get, setcreateParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, init, overrideDefaultName, register, setName, toStringclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitreloadgetFormatted, getName, getStringdefaultBoolean, 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, stringPropertiesinitpublic static final String CURRENT
public static final String REQUEST
public static final String SHARE
public static final String KEY_TOTALTIME
public static final String KEY_USERTIME
private static final String DEFNAME
private static final String DEFTOTALTIME
private Value timetotal
private StopWatch timeuser
private static final DecimalFormat df
public double rescanned(String key, String old, String newval)
rescanned in interface Reloadablerescanned in class AbstractParameterpublic void registerParameter(Parameter add)
StopWatches, one counting total observation time of the
telescope and another one counting total observation time of a user
group. The total time is identified by its name, KEY_TOTALTIME,
the user group time must have a name according to KEY_USERTIME.registerParameter in interface ParameterDependingpublic Number getValue()
public Number setValue(Number val) throws UnsupportedOperationException
setValue in interface ValueUnsupportedOperationException