|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.AbstractTargetParameter
stella.parameter.AbstractTargetValue
stella.parameter.ObservableList
public class ObservableList
A parameter that is capable of cumulating a list of observable targets along
with their highest-ever merit. This is done in a way that the parameter's
AbstractTargetValue.set(java.lang.Object) method expects a list of TargetDefinitions,
preferrably Appointables,
which is stored in an internal Map
along with the target's merit. Whenever the set method is called, all
targets already present are checked for their last merit. The current merit
is stored if it exceeds the last one, allowing retrieval of a map of
target definitions to merits using the parameter's AbstractTargetValue.get() method.
Additionally, as this parameter is also relevant for scheduling simulation,
the parameter hosts a mapping of targets to all positive merits of the
target, which are stored as date and merit at that date. This mapping of
target definitions to a list of 2-element objects (Long, Double) can be
retrieved with a call to getMeritCourse(stella.TargetDefinition).
This parameter is exit cleaning, meaning that depending on the keys
KEY_DUMPOBSERVE and KEY_DUMPCOURSE the map of
target definitions to highest merits is dumped as target names to highest
merits and the dates (as longs) with the particular merits is dumped. In
the current version, KEY_DUMPOBSERVE points to an ascii-file
name and KEY_DUMPCOURSE points to a directory.
| Nested Class Summary | |
|---|---|
private static class |
ObservableList.DateMerit
A combination of a date and a merit. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private Map<TargetDefinition,Shelf<ObservableList.DateMerit>> |
course
A map of parsed targets to merit course. |
private TargetDefinition |
current
If a target/error was registered. |
private static int |
DEFMAXENTRIES
The default size of the date-merit list. |
static String |
DEFNAME
The default name of the target list. |
private static String |
DEFTARGETMERIT
The default name of the target list. |
private static String |
DEFTIME
The default name of the target list. |
static String |
KEY_DUMPCOURSE
The directory into which the per-target merit course is writtn to. |
static String |
KEY_DUMPOBSERVE
The file name where the target names vs. |
static String |
KEY_IGNORE
The key to the comma-list of unwanted targets. |
static String |
KEY_MAXENTRIES
The file name where the target names vs. |
static String |
KEY_ONLY
The key to the comma-list of only wanted targets. |
static String |
KEY_TARGETMERIT
The name of the parameter that hold the target merit. |
static String |
KEY_TIME
The name of the parameter that holds the time. |
private TargetDependingParameter |
merit
The target depending parameter giving the merit of the target. |
private Map<TargetDefinition,Float> |
targets
A map of parsed targets to highest merit. |
private Time |
time
The current time. |
| Fields inherited from class stella.parameter.AbstractTargetParameter |
|---|
KEY_INDEX |
| Fields inherited from class stella.parameter.AbstractParameter |
|---|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface stella.ErrorDependingParameter |
|---|
NAMING_EXTENSION |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
ObservableList(Map<String,String> sprop)
Constructs a new observable targets list. |
|
| Method Summary | |
|---|---|
void |
clearObservables()
Clears the list of observable targets. |
void |
exit()
Exits this parameter. |
Object |
getForError(ErrorEvent ee)
Picks the highest-ever recorded merit for the target delivered with this error. |
Number |
getForTarget(TargetDefinition td)
Picks the highest-ever recorded merit for this target. |
List<ObservableList.DateMerit> |
getMeritCourse(TargetDefinition key)
Returns the course of this target merits. |
Number |
getValue()
Returns the same object as Parameter.get() but already cast into
a Number. |
void |
init()
Transforms the KEY_IGNORE property into a list of target names
that should be discarded. |
void |
registerError(ErrorEvent ee)
Registers a target-picked error. |
void |
registerParameter(Parameter possmerit)
Registers the target merit parameter used to deduce the highest merit during an observing period. |
void |
registerProvider(TargetProviding<? extends TargetDefinition> list)
On target registering, we create a new mapping of targets to highest merits and the linking of targets to the merit course. |
void |
registerTarget(TargetDefinition td)
Target picked is the error that issues an update. |
Number |
setValue(Number list)
Whenever this method is called with a collection of TargetDefinitions as its argument, the internal list of
observable targets is updated:
Targets present in the KEY_IGNORE list are discarded.
All targets not present in targets are added with their
current merit.
All targets already present are checked for their current merit. |
private void |
update(TargetDefinition td)
/** Tries to get the merit of the target from the associated target merit. |
| Methods inherited from class stella.parameter.AbstractTargetValue |
|---|
get, set |
| Methods inherited from class stella.parameter.AbstractTargetParameter |
|---|
getAsStar, getConstant, getFormattedFor, getSetup |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, rescanned, setName, toString |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| 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 class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface stella.Parameter |
|---|
get, getFormatted, getName, getString, set |
| 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 stella.TargetDependingParameter |
|---|
getFormattedFor |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Field Detail |
|---|
public static final String KEY_TIME
public static final String KEY_TARGETMERIT
public static final String KEY_IGNORE
public static final String KEY_ONLY
public static final String KEY_MAXENTRIES
public static final String KEY_DUMPOBSERVE
public static final String KEY_DUMPCOURSE
public static final String DEFNAME
private static final int DEFMAXENTRIES
private static final String DEFTIME
private static final String DEFTARGETMERIT
private Map<TargetDefinition,Float> targets
private Map<TargetDefinition,Shelf<ObservableList.DateMerit>> course
private TargetDependingParameter merit
private Time time
private TargetDefinition current
| Constructor Detail |
|---|
public ObservableList(Map<String,String> sprop)
| Method Detail |
|---|
public void init()
KEY_IGNORE property into a list of target names
that should be discarded. Set the time zone to GMT on the date
formatter.
init in interface Initializableinit in class AbstractParameterpublic void exit()
KEY_DUMPOBSERVE or
KEY_DUMPCOURSE is set, the mapping of targets to their highest
merits is writtn to KEY_DUMPOBSERVE, or the course of
the particular target's merit is writtn as a file named after the
target into the directory KEY_DUMPCOURSE.
exit in interface ExitCleaningexit in class AbstractParameterpublic void registerParameter(Parameter possmerit)
registerParameter in interface ParameterDependingpublic Number setValue(Number list)
TargetDefinitions as its argument, the internal list of
observable targets is updated:
KEY_IGNORE list are discarded.targets are added with their
current merit.
setValue in interface Valuepublic void registerProvider(TargetProviding<? extends TargetDefinition> list)
registerProvider in interface TargetProviderDependingpublic void registerTarget(TargetDefinition td)
registerTarget in interface TargetDependingpublic Number getForTarget(TargetDefinition td)
getForTarget in interface TargetDependingValuegetForTarget in interface TargetDependingParameterpublic Object getForError(ErrorEvent ee)
getFor with
the target definition in the error
getForError in interface ErrorDependingParameterpublic 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.
getValue in interface Valuepublic void registerError(ErrorEvent ee)
registerError in interface ErrorDependingParameterprivate void update(TargetDefinition td)
public List<ObservableList.DateMerit> getMeritCourse(TargetDefinition key)
key - A target definition.public void clearObservables()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||