Class ValueErrorPlugin
- java.lang.Object
-
- uk.ac.rdg.resc.edal.dataset.plugins.VariablePlugin
-
- uk.ac.rdg.resc.edal.dataset.plugins.ValueErrorPlugin
-
public class ValueErrorPlugin extends VariablePlugin
A plugin to group the value of a single variable with an associated error / uncertainty- Author:
- Guy Griffiths
-
-
Field Summary
Fields Modifier and Type Field Description static StringERROR_ROLEstatic StringGROUPstatic StringLOWER_ROLEstatic StringUPPER_ROLEstatic StringVALUE_ROLE-
Fields inherited from class uk.ac.rdg.resc.edal.dataset.plugins.VariablePlugin
prefixLength, uses
-
-
Constructor Summary
Constructors Constructor Description ValueErrorPlugin(String valueComponentId, String errorComponentId, String title)Construct a newValueErrorPlugin
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcombineIds(String... partsToUse)Provides a convenience method for mangling several IDs into one new one.protected VariableMetadata[]doProcessVariableMetadata(VariableMetadata... metadata)Subclasses should override this method to modify theVariableMetadatatree, and return any new objects added to it.protected NumbergenerateValue(String varSuffix, HorizontalPosition pos, Number... sourceValues)Subclasses should override this method to generate values based on source variable values-
Methods inherited from class uk.ac.rdg.resc.edal.dataset.plugins.VariablePlugin
generateArray1D, generateArray2D, getFullId, getValue, newVariableMetadataFromDomains, newVariableMetadataFromMetadata, processVariableMetadata, providesVariables, usesVariables
-
-
-
-
Field Detail
-
VALUE_ROLE
public static final String VALUE_ROLE
- See Also:
- Constant Field Values
-
ERROR_ROLE
public static final String ERROR_ROLE
- See Also:
- Constant Field Values
-
UPPER_ROLE
public static final String UPPER_ROLE
- See Also:
- Constant Field Values
-
LOWER_ROLE
public static final String LOWER_ROLE
- See Also:
- Constant Field Values
-
GROUP
public static final String GROUP
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ValueErrorPlugin
public ValueErrorPlugin(String valueComponentId, String errorComponentId, String title)
Construct a newValueErrorPlugin- Parameters:
valueComponentId- The ID of the variable representing the x-componenterrorComponentId- The ID of the variable representing the y-componenttitle- The title of the quantity which the components represent
-
-
Method Detail
-
doProcessVariableMetadata
protected VariableMetadata[] doProcessVariableMetadata(VariableMetadata... metadata)
Description copied from class:VariablePluginSubclasses should override this method to modify theVariableMetadatatree, and return any new objects added to it. This allows subclasses to arbitrarily restructure the metadata tree by calling theVariableMetadata.setParent(VariableMetadata, String)methods. Note that the IDs in the newly-createdVariableMetadataobjects should be generated by callingVariablePlugin.getFullId(String)with the variable's suffix. If the plugin is designed to group several child variables, the first child will be used to automatically estimate the scale range of the parent. This is guaranteed to only be called once.- Specified by:
doProcessVariableMetadatain classVariablePlugin- Parameters:
metadata- An array ofVariableMetadataof the source variables in the order they were supplied to the constructor- Returns:
- The derived
VariableMetadata
-
combineIds
protected String combineIds(String... partsToUse)
Description copied from class:VariablePluginProvides a convenience method for mangling several IDs into one new one. This just concatenates them, but subclasses may wish to override this if they require a specific format for IDs. This is guaranteed to be called once upon construction.- Overrides:
combineIdsin classVariablePlugin- Parameters:
partsToUse- The IDs to base this name on
-
generateValue
protected Number generateValue(String varSuffix, HorizontalPosition pos, Number... sourceValues)
Description copied from class:VariablePluginSubclasses should override this method to generate values based on source variable values- Specified by:
generateValuein classVariablePlugin- Parameters:
varSuffix- The suffix ID of the variable to generateVariableMetadatafor. This will be one of the provided suffixes in the constructor, but not the actual variable ID (which subclasses do not need to worry about)pos- TheHorizontalPositionat which the value is generated. This may affect the returned valuesourceValues- An array ofNumbers representing the source values in the order they were supplied to the constructor- Returns:
- The derived value
-
-