Record Class ValueScale.RatioToBest
java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.spi.ValueScale.RatioToBest
- All Implemented Interfaces:
ValueScale
- Enclosing interface:
ValueScale
The ratio to the best value: an option 7% dearer than the cheapest scores about 93, one twice as
dear scores 50. Needs positive values; when the best value is not positive it falls back to
ValueScale.Range.-
Nested Class Summary
Nested classes/interfaces inherited from interface ValueScale
ValueScale.Anchored, ValueScale.Percent, ValueScale.Range, ValueScale.RatioToBestModifier and TypeInterfaceDescriptionstatic final recordLinear between two fixed anchors, clamped.static final recordThe value is a percentage: it is the score when larger is better, and 100 minus it otherwise.static final recordMin-max over the options being ranked.static final recordThe ratio to the best value: an option 7% dearer than the cheapest scores about 93, one twice as dear scores 50. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RatioToBest
public RatioToBest()Creates an instance of aRatioToBestrecord class.
-
-
Method Details
-
score
- Specified by:
scorein interfaceValueScale- Parameters:
value- the raw value (never NaN)best- the best value among the options being rankedworst- the worst value among the options being rankeddirection- whether smaller or larger is better- Returns:
- the score, 0..100
-
describe
- Specified by:
describein interfaceValueScale- Returns:
- a one-line description for reports
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal.
-