Class FixedParameter

java.lang.Object
heronarts.lx.parameter.FixedParameter
All Implemented Interfaces:
LXPath, LXParameter

public class FixedParameter extends Object implements LXParameter
A FixedParameter is an immutable parameter. It will throw a RuntimeException if setValue() is attempted. Useful for anonymous placeholder values in places that expect to use LXParameters.
  • Constructor Details

    • FixedParameter

      public FixedParameter(double value)
  • Method Details

    • 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
    • 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
    • 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 FixedParameter 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
    • 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
    • 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 LXParameter reset()
      Description copied from interface: LXParameter
      A method to reset the value of the parameter, if a default is available. Not necessarily defined for all parameters, may be ignored.
      Specified by:
      reset in interface LXParameter
      Returns:
      this
    • setValue

      public LXParameter setValue(double value)
      Description copied from interface: LXParameter
      Sets the value of the parameter.
      Specified by:
      setValue in interface LXParameter
      Parameters:
      value - The value
      Returns:
      this
    • getValue

      public double getValue()
      Description copied from interface: LXParameter
      Retrieves the value of the parameter
      Specified by:
      getValue in interface LXParameter
      Returns:
      Parameter value
    • getLabel

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