Class ArbitraryGroupPlugin
- java.lang.Object
-
- uk.ac.rdg.resc.edal.dataset.plugins.VariablePlugin
-
- uk.ac.rdg.resc.edal.dataset.plugins.ArbitraryGroupPlugin
-
public class ArbitraryGroupPlugin extends VariablePlugin
A plugin to create arbitrary groups of variables.- Author:
- Guy Griffiths
-
-
Field Summary
Fields Modifier and Type Field Description static StringGROUP-
Fields inherited from class uk.ac.rdg.resc.edal.dataset.plugins.VariablePlugin
prefixLength, uses
-
-
Constructor Summary
Constructors Constructor Description ArbitraryGroupPlugin(String title, String... components)Construct a newArbitraryGroupPlugin
-
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 theVariableMetadatatree, and return any new objects added to it.protected NumbergenerateValue(String varSuffix, HorizontalPosition position, 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
-
-
-
-
Field Detail
-
GROUP
public static final String GROUP
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ArbitraryGroupPlugin
public ArbitraryGroupPlugin(String title, String... components)
Construct a newArbitraryGroupPlugin
-
-
Method Detail
-
doProcessVariableMetadata
protected VariableMetadata[] doProcessVariableMetadata(VariableMetadata... metadata) throws EdalException
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 - Throws:
EdalException- If there is a problem generating new metadata
-
generateValue
protected Number generateValue(String varSuffix, HorizontalPosition position, 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)position- 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
-
-