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 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 number
      v - number of digits to the right of the decimal place. e.g 1.00 = 2 25. = 0
      f - 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 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

      public double getPluralOperand(PluralRules.Operand operand)
      Specified by:
      getPluralOperand in interface PluralRules.IFixedDecimal
    • getOperand

      public static PluralRules.Operand getOperand(String t)
    • compareTo

      public int compareTo(PluralRules.FixedDecimal other)
      Specified by:
      compareTo in interface Comparable<PluralRules.FixedDecimal>
    • equals

      public boolean equals(Object arg0)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hasIntegerValue

      public boolean hasIntegerValue()
    • intValue

      public int intValue()
      Specified by:
      intValue in class Number
    • longValue

      public long longValue()
      Specified by:
      longValue in class Number
    • floatValue

      public float floatValue()
      Specified by:
      floatValue in class Number
    • doubleValue

      public double doubleValue()
      Specified by:
      doubleValue in class Number
    • getShiftedValue

      public long getShiftedValue()
    • isNaN

      public boolean isNaN()
      Specified by:
      isNaN in interface PluralRules.IFixedDecimal
    • isInfinite

      public boolean isInfinite()
      Specified by:
      isInfinite in interface PluralRules.IFixedDecimal