Class DifferencePlugin
- java.lang.Object
-
- uk.ac.rdg.resc.edal.dataset.plugins.VariablePlugin
-
- uk.ac.rdg.resc.edal.dataset.plugins.DifferencePlugin
-
public class DifferencePlugin extends VariablePlugin
-
-
Field Summary
-
Fields inherited from class uk.ac.rdg.resc.edal.dataset.plugins.VariablePlugin
prefixLength, uses
-
-
Constructor Summary
Constructors Constructor Description DifferencePlugin(String xVar, String yVar)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected VariableMetadata[]
doProcessVariableMetadata(VariableMetadata... metadata)
Subclasses should override this method to modify theVariableMetadata
tree, and return any new objects added to it.protected Number
generateValue(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
combineIds, generateArray1D, generateArray2D, getFullId, getValue, newVariableMetadataFromDomains, newVariableMetadataFromMetadata, processVariableMetadata, providesVariables, usesVariables
-
-
-
-
Method Detail
-
doProcessVariableMetadata
protected VariableMetadata[] doProcessVariableMetadata(VariableMetadata... metadata) throws EdalException
Description copied from class:VariablePlugin
Subclasses should override this method to modify theVariableMetadata
tree, 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-createdVariableMetadata
objects 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:
doProcessVariableMetadata
in classVariablePlugin
- Parameters:
metadata
- An array ofVariableMetadata
of the source variables in the order they were supplied to the constructor- Returns:
- The derived
VariableMetadata
- Throws:
EdalException
- If there is a problem generating new metadata
-
generateValue
protected Number generateValue(String varSuffix, HorizontalPosition pos, Number... sourceValues)
Description copied from class:VariablePlugin
Subclasses should override this method to generate values based on source variable values- Specified by:
generateValue
in classVariablePlugin
- Parameters:
varSuffix
- The suffix ID of the variable to generateVariableMetadata
for. 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
- TheHorizontalPosition
at which the value is generated. This may affect the returned valuesourceValues
- An array ofNumber
s representing the source values in the order they were supplied to the constructor- Returns:
- The derived value
-
-