Interface Parameter<S>

Type Parameters:
S -
All Superinterfaces:
Serializable
All Known Implementing Classes:
BooleanParameter, ChoiceParameter, DoubleParameter, EmptyParameter, IntParameter, NumericParameter, StringParameter

public interface Parameter<S> extends Serializable
Interface defining algorithm parameters, which need to be displayed to users somehow.
Author:
Pete Bankhead
  • Method Summary

    Modifier and Type
    Method
    Description
    Create a new Parameter with the same text and value.
    Get a default value to use if the Parameter has not been otherwise set.
    Get a description of the meaning of the Parameter; may be displayed e.g.
    Get some prompt text that may be displayed to a user.
    Get the current set value (may be null).
    Get the current set value, or any default if no value has been set.
    boolean
    Query whether getHelpText() returns a meaningful String (as opposed to null).
    boolean
    Test is the 'hidden' flag is set for the parameter.
    boolean
    isValidInput(S value)
    Query if a specified value would be valid for this parameter.
    void
    Set last value to null (so default can be used).
    void
    setHidden(boolean hidden)
    Mark that a parameter should not be displayed to a user.
    boolean
    Set last value using a string; implementing classes may need to parse this
    boolean
    setValue(S value)
    Set the Parameter to have a specified value.
  • Method Details

    • getDefaultValue

      S getDefaultValue()
      Get a default value to use if the Parameter has not been otherwise set.
      Returns:
    • setValue

      boolean setValue(S value)
      Set the Parameter to have a specified value.
      Parameters:
      value -
      Returns:
    • setStringLastValue

      boolean setStringLastValue(Locale locale, String value)
      Set last value using a string; implementing classes may need to parse this
      Parameters:
      locale -
      value -
      Returns:
    • resetValue

      void resetValue()
      Set last value to null (so default can be used).
    • getValue

      S getValue()
      Get the current set value (may be null).
      Returns:
      See Also:
    • getValueOrDefault

      S getValueOrDefault()
      Get the current set value, or any default if no value has been set.
      Returns:
      See Also:
    • getPrompt

      String getPrompt()
      Get some prompt text that may be displayed to a user.
      Returns:
    • isValidInput

      boolean isValidInput(S value)
      Query if a specified value would be valid for this parameter.
      Parameters:
      value -
      Returns:
      true if the value would be valid, false otherwise
    • setHidden

      void setHidden(boolean hidden)
      Mark that a parameter should not be displayed to a user. This is useful, for example, if a parameter list changes the parameters to be displayed depending upon the image available or current settings, e.g. using different parameters when the pixel size is known in microns.
      Parameters:
      hidden -
    • isHidden

      boolean isHidden()
      Test is the 'hidden' flag is set for the parameter.
      Returns:
    • duplicate

      Parameter<S> duplicate()
      Create a new Parameter with the same text and value.
      Returns:
    • hasHelpText

      boolean hasHelpText()
      Query whether getHelpText() returns a meaningful String (as opposed to null).
      Returns:
    • getHelpText

      String getHelpText()
      Get a description of the meaning of the Parameter; may be displayed e.g. as a tooltip.
      Returns: