public class ProposalTime extends AbstractTargetValue implements ErrorDependingParameter, Preserving, EndpointConstraining
| Modifier and Type | Class and Description |
|---|---|
static class |
ProposalTime.Dump
Dumps all proposal times to system out, converting durations to hours on
the fly.
|
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private String |
curprop
Proposal ID of lately registered target.
|
static String |
DEFNAME
The default name of this value.
|
static String |
KEY_PROPOSALDB
None-default proposal-sql properties.
|
private Map<String,Long> |
spent
Linkes proposal ids to time spent.
|
KEY_INDEXKEY_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_MAPSEPARATORNAMING_EXTENSIONCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
ProposalTime(Map<String,String> info) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getForError(ErrorEvent error)
Nothing special to return here, errors do not change the value per se.
|
Number |
getForTarget(TargetDefinition td)
This is now possible, to return a more specific object, like for
a value we return a number.
|
private Long |
getProposalTime(String propid) |
Number |
getValue()
Returns the same object as
Parameter.get() but already cast into
a Number. |
void |
init()
Initializes the parameter with its class name.
|
boolean |
isCompleted(Appointable.Constraint lim,
TargetDefinition star)
Returns true, if the observing program on the target is finished.
|
boolean |
preserve()
No need to do anything here, is alreday writtn in the db.
|
void |
registerError(ErrorEvent error)
Registers a weather surveyor permanently to this parameter.
|
void |
registerTarget(TargetDefinition star)
Registers a target definition to this instance.
|
boolean |
restore()
We need access to the archive db, then we restore by summing over
|
Number |
setValue(Number set)
Calls
Parameter.set(java.lang.Object) but returns the previously set value as a
Number. |
get, setgetAsStar, getConstant, getFormattedFor, getSetupcreateParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, overrideDefaultName, register, rescanned, 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, waitexitdefaultBoolean, 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, stringPropertiesgetFormattedForpublic static final String KEY_PROPOSALDB
public static final String DEFNAME
private String curprop
public void init()
throws InitException
AbstractParameterinit in interface Initializableinit in class AbstractParameterInitExceptionpublic Number getValue()
ValueParameter.get() but already cast into
a Number. Primitive data types can directly be extracted from
this number without any further explicit casting.public Number setValue(Number set) throws UnsupportedOperationException
ValueParameter.set(java.lang.Object) but returns the previously set value as a
Number.setValue in interface ValueUnsupportedOperationExceptionpublic Object getForError(ErrorEvent error)
getForError in interface ErrorDependingParameterpublic void registerError(ErrorEvent error)
ErrorDependingParameterParameter.get() method will refer to
this weather station.registerError in interface ErrorDependingParameterpublic boolean preserve()
preserve in interface Preservingpublic boolean restore()
select sum(duration) from done,task where success='t' and task.object=done.objidThe main methods are in
and propid='loop-over-all-proposals.'
restore in interface PreservingProposalSqlpublic void registerTarget(TargetDefinition star)
TargetDependingregisterTarget in interface TargetDependingpublic Number getForTarget(TargetDefinition td)
TargetDependingValuegetForTarget in interface TargetDependingParametergetForTarget in interface TargetDependingValuepublic boolean isCompleted(Appointable.Constraint lim, TargetDefinition star)
EndpointConstrainingisCompleted in interface EndpointConstraining