Package org.elasticsearch.common.unit
Class RatioValue
- java.lang.Object
-
- org.elasticsearch.common.unit.RatioValue
-
public class RatioValue extends java.lang.ObjectUtility class to represent ratio and percentage values between 0 and 100
-
-
Constructor Summary
Constructors Constructor Description RatioValue(double percent)
-
Method Summary
Modifier and Type Method Description doublegetAsPercent()doublegetAsRatio()static RatioValueparseRatioValue(java.lang.String sValue)Parses the provided string as aRatioValue, the string can either be in percentage format (eg.java.lang.StringtoString()
-
-
-
Method Detail
-
getAsRatio
public double getAsRatio()
-
getAsPercent
public double getAsPercent()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
parseRatioValue
public static RatioValue parseRatioValue(java.lang.String sValue)
Parses the provided string as aRatioValue, the string can either be in percentage format (eg. 73.5%), or a floating-point ratio format (eg. 0.735)
-
-