Class ValueErrorPlugin


  • public class ValueErrorPlugin
    extends VariablePlugin
    A plugin to group the value of a single variable with an associated error / uncertainty
    Author:
    Guy Griffiths
    • Constructor Detail

      • ValueErrorPlugin

        public ValueErrorPlugin​(String valueComponentId,
                                String errorComponentId,
                                String title)
        Construct a new ValueErrorPlugin
        Parameters:
        valueComponentId - The ID of the variable representing the x-component
        errorComponentId - The ID of the variable representing the y-component
        title - The title of the quantity which the components represent
    • Method Detail

      • combineIds

        protected String combineIds​(String... partsToUse)
        Description copied from class: VariablePlugin
        Provides 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:
        combineIds in class VariablePlugin
        Parameters:
        partsToUse - The IDs to base this name on
      • 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 class VariablePlugin
        Parameters:
        varSuffix - The suffix ID of the variable to generate VariableMetadata 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 - The HorizontalPosition at which the value is generated. This may affect the returned value
        sourceValues - An array of Numbers representing the source values in the order they were supplied to the constructor
        Returns:
        The derived value