Class Currency


  • public class Currency
    extends java.lang.Object
    Currency object to be used from inside the calculation framework. It simply combines a code and the number of digits available for that currency. Actually this class only exists because Currency does not support creation of artificial currencies.
    • Constructor Summary

      Constructors 
      Constructor Description
      Currency​(java.lang.String isocode, int digits)
      Creates a new currency with given iso code and digits.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      A Currency is equal to an object if this object is also a Currency and this currency has the same digit count and the isocode is equal (ignore case) to the other isocode.
      int getDigits()  
      java.lang.String getIsoCode()  
      int hashCode()  
      java.lang.String toString()  
      static Currency valueOf​(java.lang.String code, int digits)
      Shortcut for getting commonly used currency instances.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Currency

        public Currency​(java.lang.String isocode,
                        int digits)
        Creates a new currency with given iso code and digits.
    • Method Detail

      • valueOf

        public static Currency valueOf​(java.lang.String code,
                                       int digits)
        Shortcut for getting commonly used currency instances. Prefer this to Currency(String, int) since this method caches instances.
      • equals

        public boolean equals​(java.lang.Object obj)
        A Currency is equal to an object if this object is also a Currency and this currency has the same digit count and the isocode is equal (ignore case) to the other isocode.
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getIsoCode

        public java.lang.String getIsoCode()
      • getDigits

        public int getDigits()