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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description booleanisNegativedoublesource
-
Constructor Summary
Constructors Constructor Description FixedDecimal(double n)FixedDecimal(double n, int v)FixedDecimal(double n, int v, long f)FixedDecimal(long n)FixedDecimal(String n)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(PluralRules.FixedDecimal other)static intdecimals(double n)Return a guess as to the number of decimals that would be displayed.doubledoubleValue()booleanequals(Object arg0)floatfloatValue()intgetBaseFactor()longgetDecimalDigits()longgetDecimalDigitsWithoutTrailingZeros()longgetIntegerValue()static PluralRules.OperandgetOperand(String t)doublegetPluralOperand(PluralRules.Operand operand)longgetShiftedValue()doublegetSource()intgetVisibleDecimalDigitCount()intgetVisibleDecimalDigitCountWithoutTrailingZeros()inthashCode()booleanhasIntegerValue()intintValue()booleanisHasIntegerValue()booleanisInfinite()booleanisNaN()booleanisNegative()longlongValue()StringtoString()-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
Constructor Detail
-
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
public FixedDecimal(String n)
-
-
Method Detail
-
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
public double getPluralOperand(PluralRules.Operand operand)
- Specified by:
getPluralOperandin interfacePluralRules.IFixedDecimal
-
getOperand
public static PluralRules.Operand getOperand(String t)
-
compareTo
public int compareTo(PluralRules.FixedDecimal other)
- Specified by:
compareToin interfaceComparable<PluralRules.FixedDecimal>
-
hasIntegerValue
public boolean hasIntegerValue()
-
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
-
-