Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.knowgate.math
Class CurrencyCode

    java.lang.Object
      com.knowgate.math.CurrencyCode

    public final class CurrencyCode

extends java.lang.Object

Currency Code

Field Summary
`static CurrencyCode` | `CNY`
`static CurrencyCode` | `EUR`
`static CurrencyCode` | `GBP`
`static CurrencyCode` | `JPY`
`static CurrencyCode` | `RUB`
`static CurrencyCode` | `USD`

Constructor Summary
`CurrencyCode(int iNum, java.lang.String sAlpha, java.lang.String sSign, java.lang.String sId, java.lang.String sNm, java.lang.String sTrEn)` Constructor

Method Summary
`java.lang.String` | `alphaCode()` Three letter currency code
`double` | `conversionRateTo(CurrencyCode oTarget)` Get conversion rate to another currency using a web service to find it
`double` | `conversionRateTo(java.lang.String sTarget)` Get conversion rate to another currency using a web service to find it
`java.lang.String` | `countryCode()`
`java.util.Currency` | `currency()` Corresponding java.util.Currency object
`static CurrencyCode` | `currencyCodeFor(int iNumCode)`
`static CurrencyCode` | `currencyCodeFor(java.lang.String sAlphaCode)` Get CurrencyCode for a 3 letter currency identifier
`java.lang.String` | `currencyName()`
`boolean` | `equals(CurrencyCode oCurCod)`
`int` | `numericCode()`
`java.lang.String` | `singleCharSign()` A single sign like $ € £ ¥
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### CNY

    public static final CurrencyCode CNY

### EUR

    public static final CurrencyCode EUR

### GBP

    public static final CurrencyCode GBP

### JPY

    public static final CurrencyCode JPY

### USD

    public static final CurrencyCode USD

### RUB

    public static final CurrencyCode RUB

Constructor Detail

### CurrencyCode

    public CurrencyCode(int iNum,
                        java.lang.String sAlpha,
                        java.lang.String sSign,
                        java.lang.String sId,
                        java.lang.String sNm,
                        java.lang.String sTrEn)
                 throws java.lang.NullPointerException,
                        java.lang.IllegalArgumentException

  Constructor

  Parameters:
    `iNum` - int
    `sAlpha` - String ISO 4217 3-letter code
    `sSign` - String "$", "€", "£", etc.
    `sId` - String ISO-639 two letter country code
    `sNm` - String Country Name
    `sTrEn` - String Currency Name (english)
  Throws:
    `java.lang.NullPointerException` - if currencyCode is null
    `java.lang.IllegalArgumentException` - if currencyCode is not a supported ISO 4217 code.

Method Detail

### currency

    public java.util.Currency currency()

  Corresponding java.util.Currency object

### countryCode

    public java.lang.String countryCode()

### alphaCode

    public java.lang.String alphaCode()

  Three letter currency code

### singleCharSign

    public java.lang.String singleCharSign()

  A single sign like $ € £ ¥

### currencyName

    public java.lang.String currencyName()

### numericCode

    public int numericCode()

### equals

    public boolean equals(CurrencyCode oCurCod)

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### currencyCodeFor

    public static CurrencyCode currencyCodeFor(java.lang.String sAlphaCode)

  Get CurrencyCode for a 3 letter currency identifier

  Returns:
    CurrencyCode instance for given code or null if no currency was found for that code

### currencyCodeFor

    public static CurrencyCode currencyCodeFor(int iNumCode)

### conversionRateTo

    public double conversionRateTo(CurrencyCode oTarget)
                            throws java.lang.NullPointerException,
                                   java.lang.NumberFormatException

  Get conversion rate to another currency using a web service to find it

  Parameters:
    `oTarget` - Target CurrencyCode
  Throws:
    `java.lang.NullPointerException` - if oTarget is null
    `java.lang.NumberFormatException`

### conversionRateTo

    public double conversionRateTo(java.lang.String sTarget)
                            throws java.lang.NullPointerException,
                                   java.lang.NumberFormatException

  Get conversion rate to another currency using a web service to find it

  Parameters:
    `sTarget` - 3 letter Target Currency Code
  Throws:
    `java.lang.NullPointerException` - if oTarget is null
    `java.lang.NumberFormatException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD