Class ScaleType.Param

java.lang.Object
uk.ac.starlink.ttools.plot2.ScaleType.Param
Enclosing class:
ScaleType

public abstract static class ScaleType.Param extends Object
Defines a numerical parameter for a ScaleType. To create a Scale instance, a value for each Param needs to be supplied to the ScaleType.
Since:
20 Mar 2025
Author:
Mark Taylor
  • Constructor Summary

    Constructors
    Constructor
    Description
    Param(String name, double dflt, String description)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the parameter default value.
    Returns a short description of this parameter.
    Returns the parameter name.
    abstract double
    nextDown(double d)
    Given a value for this parameter, returns a smaller number that would be a suitable value.
    abstract double
    nextUp(double d)
    Given a value for this parameter, returns a larger number that would be a suitable value.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Param

      public Param(String name, double dflt, String description)
      Constructor.
      Parameters:
      name - parameter name
      dflt - parameter default value
      description - short text description of parameter
  • Method Details

    • getName

      public String getName()
      Returns the parameter name.
      Returns:
      name
    • getDefault

      public double getDefault()
      Returns the parameter default value.
      Returns:
      default value
    • getDescription

      public String getDescription()
      Returns a short description of this parameter.
      Returns:
      description
    • nextDown

      public abstract double nextDown(double d)
      Given a value for this parameter, returns a smaller number that would be a suitable value.

      This is used for the GUI. The scaling will still work, though the GUI will be suboptimal, if this is implemented as the identity.

      Parameters:
      d - example parameter value
      Returns:
      round number smaller than d
    • nextUp

      public abstract double nextUp(double d)
      Given a value for this parameter, returns a larger number that would be a suitable value.

      This is used for the GUI. The scaling will still work, though the GUI will be suboptimal, if this is implemented as the identity.

      Parameters:
      d - example parameter value
      Returns:
      round number greater than d
    • toString

      public String toString()
      Overrides:
      toString in class Object