public class

IntEvaluator

extends Object
implements Evaluator<T>
java.lang.Object
   ↳ com.shinobicontrols.charts.IntEvaluator

Class Overview

Uses linear interpolation to find an Integer value based on a given proportion and the specified startValue and endValue.

Summary

Public Constructors
IntEvaluator(int startValue, int endValue)
Creates a new IntEvaluator with the given startValue and endValue.
Public Methods
Integer evaluate(float proportion)
Uses linear interpolation to find an Integer value based on the given proportion and the specified startValue and endValue.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.shinobicontrols.charts.Evaluator

Public Constructors

public IntEvaluator (int startValue, int endValue)

Creates a new IntEvaluator with the given startValue and endValue.

Parameters
startValue the evaluated value for a proportion of 0.0
endValue the evaluated value for a proportion of 1.0

Public Methods

public Integer evaluate (float proportion)

Uses linear interpolation to find an Integer value based on the given proportion and the specified startValue and endValue.

A proportion of 0.0 will return startValue while a proportion of 1.0 will return endValue. It is possible for proportion to be less than 0.0 or greater than 1.0 and therefore the evaluated value may be less than the startValue or greater than the endValue.

Where a proportion evaluates to a non-whole number, the value returned will be rounded down, that is, the floor of the value will be returned.

Parameters
proportion the proportion of the animated quantity
Returns
  • the value of the animated quantity based on the startValue and endValue at a certain proportion