Class SliderInput

java.lang.Object
com.ultikits.ultitools.ui.SliderInput
All Implemented Interfaces:
FormInput<Double>

public final class SliderInput extends Object implements FormInput<Double>
A number from a range. Value: min + k * step for an integer k >= 0, at most max; max - min must be a whole number of steps. A value read through FormResponse#get is exactly min + k * step as computed in double arithmetic, or exactly max for the largest k.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A reusable, non-thread-safe builder.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final double
     
    private final String
     
    private final Text
     
    private final double
     
    private final double
     
    private final double
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    builder(String key, Text label, double min, double max)
    Starts a finite range, initially at its minimum, with step 1.
    boolean
    equals(@Nullable Object o)
     
    int
     
    double
    Initial value within the range.
    key()
    Unique within its form; [a-z0-9_]+, at most 32 characters.
    The deferred label.
    double
    max()
    Inclusive maximum.
    double
    min()
    Inclusive minimum.
    double
    Positive increment from the minimum.
    (package private) static long
    steps(double from, double to, double step)
     
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • key

      private final String key
    • label

      private final Text label
    • min

      private final double min
    • max

      private final double max
    • step

      private final double step
    • initial

      private final double initial
  • Constructor Details

  • Method Details

    • builder

      public static SliderInput.Builder builder(String key, Text label, double min, double max)
      Starts a finite range, initially at its minimum, with step 1.
    • key

      public String key()
      Description copied from interface: FormInput
      Unique within its form; [a-z0-9_]+, at most 32 characters.
      Specified by:
      key in interface FormInput<Double>
    • label

      public Text label()
      Description copied from interface: FormInput
      The deferred label.
      Specified by:
      label in interface FormInput<Double>
    • min

      public double min()
      Inclusive minimum.
    • max

      public double max()
      Inclusive maximum.
    • step

      public double step()
      Positive increment from the minimum.
    • initial

      public double initial()
      Initial value within the range.
    • equals

      public boolean equals(@Nullable @Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • steps

      static long steps(double from, double to, double step)