Interface RangeModel<T>

Type Parameters:
T - the object that this model returns.
All Known Implementing Classes:
FloatRangeModel, IntRangeModel

public interface RangeModel<T>
A data model to use with objects that have a range of values and a way to select them by varying input along a floating-point scale.
Author:
Matthew Tropiano
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    double
    Returns a scalar from 0 to 1 using a value that could be in this model.
    getValueForScalar(double scalar)
    Returns a value in this model using a variable scalar.
    boolean
    isInRange(T value)
    Returns if the input value is in the range.
  • Method Details

    • getMinValue

      T getMinValue()
      Returns:
      the minimum value of this model.
    • getMaxValue

      T getMaxValue()
      Returns:
      the maximum value of this model.
    • isInRange

      boolean isInRange(T value)
      Returns if the input value is in the range.
      Parameters:
      value - the value to test.
      Returns:
      true if so, false if not.
    • getValueForScalar

      T getValueForScalar(double scalar)
      Returns a value in this model using a variable scalar.
      Parameters:
      scalar - a value from 0 to 1, inclusive.
      Returns:
      the closest value.
    • getScalarForValue

      double getScalarForValue(T value)
      Returns a scalar from 0 to 1 using a value that could be in this model.
      Parameters:
      value - a value that could conceivably fit in the model.
      Returns:
      the scalar result.