Class PluralRules.FixedDecimal
- java.lang.Object
-
- java.lang.Number
-
- com.vmware.vipclient.i18n.l2.plural.parser.PluralRules.FixedDecimal
-
- All Implemented Interfaces:
PluralRules.IFixedDecimal,java.io.Serializable,java.lang.Comparable<PluralRules.FixedDecimal>
- Enclosing class:
- PluralRules
public static class PluralRules.FixedDecimal extends java.lang.Number implements java.lang.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(java.lang.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(java.lang.Object arg0)floatfloatValue()intgetBaseFactor()longgetDecimalDigits()longgetDecimalDigitsWithoutTrailingZeros()longgetIntegerValue()static PluralRules.OperandgetOperand(java.lang.String t)doublegetPluralOperand(PluralRules.Operand operand)longgetShiftedValue()doublegetSource()intgetVisibleDecimalDigitCount()intgetVisibleDecimalDigitCountWithoutTrailingZeros()inthashCode()booleanhasIntegerValue()intintValue()booleanisHasIntegerValue()booleanisInfinite()booleanisNaN()booleanisNegative()longlongValue()java.lang.StringtoString()
-
-
-
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(java.lang.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(java.lang.String t)
-
compareTo
public int compareTo(PluralRules.FixedDecimal other)
- Specified by:
compareToin interfacejava.lang.Comparable<PluralRules.FixedDecimal>
-
equals
public boolean equals(java.lang.Object arg0)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hasIntegerValue
public boolean hasIntegerValue()
-
intValue
public int intValue()
- Specified by:
intValuein classjava.lang.Number
-
longValue
public long longValue()
- Specified by:
longValuein classjava.lang.Number
-
floatValue
public float floatValue()
- Specified by:
floatValuein classjava.lang.Number
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein classjava.lang.Number
-
getShiftedValue
public long getShiftedValue()
-
isNaN
public boolean isNaN()
- Specified by:
isNaNin interfacePluralRules.IFixedDecimal
-
isInfinite
public boolean isInfinite()
- Specified by:
isInfinitein interfacePluralRules.IFixedDecimal
-
-