|
||||||||||
| 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.RankProvider
public class RankProvider
A frame provider is a parameter that defines a certain rectangluar areas, normally depending on target picked and/or error received. This frame could be a read-out frasme on a CCD, but also a frame defining a useful area or a frame defining a moments-area.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
static String |
DEFNAME
Default name of this parameter. |
private Integer |
defrank
This is the default frame size or null if undefined. |
private Map<Object,Map<Class<? extends ErrorEvent>,Integer>> |
errors
This lookup-table links target types to lookups of error to frames . |
static String |
KEY_DEFAULTRANK
This is the default frame, prior to target registering. |
static String |
KEY_LISTENFOR
We ignore all errors not in this list. |
static String |
KEY_MESSAGETABLE
This keys links the combined target type plus error to frames . |
static String |
KEY_TARGETTABLE
This key links target types to frame entries. |
private Class<? extends ErrorEvent> |
lasterror
Last error event recorded after target registering. |
private Object |
lasttype
Last target type registered. |
private List<Class<? extends ErrorEvent>> |
listen
We only listen to these errors. |
private Map<Object,Integer> |
targets
This lookup-table links target types to frames. |
static char |
TYPEERRORSEPARATOR
This char separates the target type from the error class name in prop. |
| 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 | |
|---|---|
RankProvider(Map<String,String> prop)
We start by constructing all the lookup-tables in the init section. |
|
| Method Summary | |
|---|---|
Number |
getForError(ErrorEvent ee)
Returns the sub-frame of the currently registered target that would be active on the specified error. |
Number |
getForTarget(TargetDefinition td)
Returns the frame that would be used with the stated target, no error class can be specified. |
private Integer |
getRank(Object type,
Class<? extends ErrorEvent> ee)
Returns the subframe for a given target type and a specified errror. |
Number |
getValue()
After registering of targets and possible erros, we can produce a frame. |
void |
init()
On init, we parse the default rectangle and try to construct all the lookup tables. |
private Map<String,Integer> |
parseToInteger(String s)
We parse a properties mapping to a string-to-rectangle mapping. |
void |
registerError(ErrorEvent ee)
Registers the error. |
void |
registerTarget(TargetDefinition td)
Registers the target, clears the error received. |
Number |
setValue(Number o)
Not allowed. |
| 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, exit, 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 char TYPEERRORSEPARATOR
public static final String KEY_LISTENFOR
public static final String KEY_DEFAULTRANK
public static final String KEY_TARGETTABLE
public static final String KEY_MESSAGETABLE
public static final String DEFNAME
private Integer defrank
private Map<Object,Integer> targets
private Map<Object,Map<Class<? extends ErrorEvent>,Integer>> errors
private Object lasttype
private Class<? extends ErrorEvent> lasterror
private List<Class<? extends ErrorEvent>> listen
| Constructor Detail |
|---|
public RankProvider(Map<String,String> prop)
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class AbstractParameterpublic void registerTarget(TargetDefinition td)
registerTarget in interface TargetDependingpublic void registerError(ErrorEvent ee)
registerError in interface ErrorDependingParameterpublic Number getForTarget(TargetDefinition td)
getForTarget in interface TargetDependingValuegetForTarget in interface TargetDependingParameterpublic Number getForError(ErrorEvent ee)
getForError in interface ErrorDependingParameterpublic Number getValue()
getValue in interface Valuepublic Number setValue(Number o)
setValue in interface Valueprivate Map<String,Integer> parseToInteger(String s)
private Integer getRank(Object type,
Class<? extends ErrorEvent> ee)
errors is scanned, if
that does not produce a hit, the targets table is scanned.
If again without hit, the default frame is returned, which still
might be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||