Class FunctionalParameter

java.lang.Object
heronarts.lx.parameter.FunctionalParameter
All Implemented Interfaces:
LXPath, LXParameter
Direct Known Subclasses:
BoundedFunctionalParameter

public abstract class FunctionalParameter extends Object implements LXParameter
An LXParameter that has a value computed by a function, which may combine the values of other parameters, or call some function, etc.
  • Field Details

    • description

      protected String description
  • Constructor Details

    • FunctionalParameter

      protected FunctionalParameter()
    • FunctionalParameter

      protected FunctionalParameter(String label)
  • Method Details

    • create

      public static FunctionalParameter create(FunctionalParameter.Interface iface)
    • getDescription

      public String getDescription()
      Description copied from interface: LXPath
      Returns a contextual help message explaining the purpose of this parameter or component to the user, or null if none is available.
      Specified by:
      getDescription in interface LXPath
      Returns:
      Contextual help string explaining purpose of the element
    • setDescription

      public FunctionalParameter setDescription(String description)
    • setComponent

      public LXParameter setComponent(LXComponent parent, String path)
      Description copied from interface: LXParameter
      Sets the component that owns this parameter
      Specified by:
      setComponent in interface LXParameter
      Parameters:
      parent - Component
      path - Path name for parameter
      Returns:
      this
    • getParent

      public LXComponent getParent()
      Description copied from interface: LXPath
      Returns the component that this object belongs to
      Specified by:
      getParent in interface LXPath
      Returns:
      Parent component of this path object, or null if it is unowned
    • getPath

      public String getPath()
      Description copied from interface: LXPath
      Returns the immediate path of this component, relative to its parent
      Specified by:
      getPath in interface LXPath
      Returns:
      Path of this object relative to its parent component
    • getPolarity

      public LXParameter.Polarity getPolarity()
      Description copied from interface: LXParameter
      Gets the polarity of this parameter.
      Specified by:
      getPolarity in interface LXParameter
      Returns:
      polarity of this parameter
    • getFormatter

      public LXParameter.Formatter getFormatter()
      Description copied from interface: LXParameter
      Gets the formatter to be used for printing this parameter's value
      Specified by:
      getFormatter in interface LXParameter
      Returns:
      Formatter
    • setFormatter

      public FunctionalParameter setFormatter(LXParameter.Formatter formatter)
      Description copied from interface: LXParameter
      Sets the formatter used for printing this parameter's value
      Specified by:
      setFormatter in interface LXParameter
      Parameters:
      formatter - Formatter
      Returns:
      The parameter
    • getUnits

      public LXParameter.Units getUnits()
      Description copied from interface: LXParameter
      Gets the unit format that this parameter's value stores.
      Specified by:
      getUnits in interface LXParameter
      Returns:
      Units
    • dispose

      public void dispose()
      Description copied from interface: LXParameter
      Invoked when the parameter is done being used and none of its resources are needed anymore.
      Specified by:
      dispose in interface LXParameter
    • reset

      public FunctionalParameter reset()
      Does nothing, subclass may override.
      Specified by:
      reset in interface LXParameter
      Returns:
      this
    • setValue

      public LXParameter setValue(double value)
      Not supported for this parameter type unless subclass overrides.
      Specified by:
      setValue in interface LXParameter
      Parameters:
      value - The value
      Returns:
      this
    • getValue

      public abstract double getValue()
      Retrieves the value of the parameter, subclass must implement.
      Specified by:
      getValue in interface LXParameter
      Returns:
      Parameter value
    • getLabel

      public final String getLabel()
      Gets the label for this parameter
      Specified by:
      getLabel in interface LXParameter
      Specified by:
      getLabel in interface LXPath
      Returns:
      Label of parameter