Class PluralRules.FixedDecimal
java.lang.Object
java.lang.Number
com.vmware.vipclient.i18n.l2.plural.parser.PluralRules.FixedDecimal
- All Implemented Interfaces:
PluralRules.IFixedDecimal,Serializable,Comparable<PluralRules.FixedDecimal>
- Enclosing class:
- PluralRules
public static class PluralRules.FixedDecimal
extends Number
implements Comparable<PluralRules.FixedDecimal>, PluralRules.IFixedDecimal
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFixedDecimal(double n) FixedDecimal(double n, int v) FixedDecimal(double n, int v, long f) FixedDecimal(long n) -
Method Summary
Modifier and TypeMethodDescriptionintstatic intdecimals(double n) Return a guess as to the number of decimals that would be displayed.doublebooleanfloatintlonglonglongstatic PluralRules.OperandgetOperand(String t) doublegetPluralOperand(PluralRules.Operand operand) longdoubleintintinthashCode()booleanintintValue()booleanbooleanbooleanisNaN()booleanlongtoString()Methods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
source
public final double source -
isNegative
public final boolean isNegative
-
-
Constructor Details
-
FixedDecimal
public FixedDecimal(double n, int v, long f) - Parameters:
n- is the original numberv- number of digits to the right of the decimal place. e.g 1.00 = 2 25. = 0f- Corresponds to f in the plural rules grammar. The digits to the right of the decimal place as an integer. e.g 1.10 = 10
-
FixedDecimal
public FixedDecimal(double n, int v) -
FixedDecimal
public FixedDecimal(double n) -
FixedDecimal
public FixedDecimal(long n) -
FixedDecimal
-
-
Method Details
-
getSource
public double getSource() -
getVisibleDecimalDigitCount
public int getVisibleDecimalDigitCount() -
getVisibleDecimalDigitCountWithoutTrailingZeros
public int getVisibleDecimalDigitCountWithoutTrailingZeros() -
getDecimalDigits
public long getDecimalDigits() -
getDecimalDigitsWithoutTrailingZeros
public long getDecimalDigitsWithoutTrailingZeros() -
getIntegerValue
public long getIntegerValue() -
isHasIntegerValue
public boolean isHasIntegerValue() -
isNegative
public boolean isNegative() -
getBaseFactor
public int getBaseFactor() -
decimals
public static int decimals(double n) Return a guess as to the number of decimals that would be displayed. This is only a guess; callers should always supply the decimals explicitly if possible. -
getPluralOperand
- Specified by:
getPluralOperandin interfacePluralRules.IFixedDecimal
-
getOperand
-
compareTo
- Specified by:
compareToin interfaceComparable<PluralRules.FixedDecimal>
-
equals
-
hashCode
public int hashCode() -
toString
-
hasIntegerValue
public boolean hasIntegerValue() -
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
getShiftedValue
public long getShiftedValue() -
isNaN
public boolean isNaN()- Specified by:
isNaNin interfacePluralRules.IFixedDecimal
-
isInfinite
public boolean isInfinite()- Specified by:
isInfinitein interfacePluralRules.IFixedDecimal
-