www.element4solution.com

e4s.application
Class CurrencyCode

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.util.E4String
          extended by e4s.application.CurrencyCode
All Implemented Interfaces:
java.lang.Comparable

public class CurrencyCode
extends E4String

ISO CurrencyCode-Code datatype and definitions.

See Also:
E4ApplObj_Intf.getCountryCode(), E4ModuleImplementation.getCountryCode(), E4ServletImplementation_Intf.getCountryCode(), T_E4S_CLIENT_Sel.get_COUNTRY(), Language,

Example_CurrencyCode.java

http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml


Nested Class Summary
static class CurrencyCode.CURRENCY
           
 
Field Summary
static E4DBColumnType _DATATYPE
           
static CurrencyCode C_AUD
           
static CurrencyCode C_BGN
           
static CurrencyCode C_CAD
           
static CurrencyCode C_CHF
           
static CurrencyCode C_CNY
           
static CurrencyCode C_CYP
           
static CurrencyCode C_CZK
           
static CurrencyCode C_DKK
           
static CurrencyCode C_EEK
           
static CurrencyCode C_EUR
           
static CurrencyCode C_GBP
           
static CurrencyCode C_HKD
           
static CurrencyCode C_HRK
           
static CurrencyCode C_HUF
           
static CurrencyCode C_IDR
           
static CurrencyCode C_ISK
           
static CurrencyCode C_JPY
           
static CurrencyCode C_KRW
           
static CurrencyCode C_LTL
           
static CurrencyCode C_LVL
           
static CurrencyCode C_MTL
           
static CurrencyCode C_MYR
           
static CurrencyCode C_NOK
           
static CurrencyCode C_NZD
           
static CurrencyCode C_PHP
           
static CurrencyCode C_PLN
           
static CurrencyCode C_RON
           
static CurrencyCode C_RUB
           
static CurrencyCode C_SEK
           
static CurrencyCode C_SGD
           
static CurrencyCode C_SKK
           
static CurrencyCode C_THB
           
static CurrencyCode C_TRL
           
static CurrencyCode C_TRY
           
static CurrencyCode C_USD
           
static CurrencyCode C_ZAR
           
static java.lang.String CURRENCY_EUR_SYMBOL
          Defines the string for EUR "€" (€).
static java.lang.String CURRENCY_GBP_SYMBOL
          Defines the string for GBP "£" (£).
static java.lang.String CURRENCY_JPY_SYMBOL
          Defines the string for JPY "¥" (¥)
static java.lang.String CURRENCY_USD_SYMBOL
          Defines the string for USD "$"
static int LEN
           
static java.lang.String URL_EUROFXREF
          Reference to EURO exchange rates.
 
Fields inherited from class e4s.util.E4String
CLASSNAME, m_maxsize, m_nullable, m_string
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Constructor Summary
CurrencyCode(char[] initval)
           
CurrencyCode(E4String initval)
           
CurrencyCode(java.lang.String initval)
           
CurrencyCode(java.lang.StringBuffer initval)
           
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
static void addLegend(E4HtmlContentElement element, E4ApplObj_Intf applobj)
           
static CurrencyCode.CURRENCY[] getCurrencies()
          Get an array of country definitions - including ISO code, name and flag if defined.
 java.lang.String getCurrencyCode()
          Get the county code, same as E4String.getString().
static E4SelectValues getCurrencySelection()
           
static E4SelectValues getCurrencySelection(CurrencyCode[] filtered)
          Get a country selection for all the countries listed in the specified array.
static java.util.Date getLastSyncDate()
          Date and Time of last synchronization with EZB.
 E4Label_Intf getName()
          Get the name associated with this currency code.
static E4Label_Intf getName(CurrencyCode code)
          Get the associated english name for a currency code.
 java.lang.String getPicture()
          Deprecated.  
 float getRate()
          Get the current exchange rate to EURO issued by the EZB.
static float getRate(CurrencyCode code)
          Get the current exchange rate to EURO issued by the EZB.
static float getRate(CurrencyCode from, CurrencyCode to)
          Get the exchange rate of one currency into another.
 java.lang.String getSymbol()
          Get the associated symbol ($, €, ..) for this currency code, if defined.
static java.lang.String getSymbol(CurrencyCode code)
          Get the associated symbol ($, €, ..) for a currency code, if defined.
 java.lang.String getSymbolOrCode()
          If available, uses a currency symbol such as the DOllar-, Euro, Yen- Sign and if not, uses the currency-code.
static java.lang.String getSymbolOrCode(CurrencyCode code)
          If available, uses a currency symbol such as the DOllar-, Euro, Yen- Sign and if not, uses the currency-code.
static E4DBTypeUsage[] getUsage()
          Returns null, only for compatibility reasons.
static void init()
           
static CurrencyCode newInstance(java.lang.String string)
          Make an instance of a country code or return null if the specified value is null.
 
Methods inherited from class e4s.util.E4String
_equals, charAt, clone, compareTo, compareTo, compareTo, compareToIgnoreCase, compareToIgnoreCase, concat, concat, concat, concat, concat, cut, cut, endsWith, endsWith, equals, equals, equalsIgnoreCase, equalsIgnoreCase, fixed, fixedRight, getMaxSize, getNullable, getString, hashCode, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, left, left, length, matches, matchesIgnoreCase, regionMatches, regionMatches, regionMatches, regionMatches, remove, removeSpaces, removeSpaces, replace, replace, replace, replace, replace, replaceIgnoreCase, right, right, setMaxSize, setNullable, setString, startsWith, startsWith, startsWith, startsWith, substring, substring, toCharArray, toLowerCase, toLowerCase, toString, toUpperCase, toUpperCase, trim, validate
 
Methods inherited from class e4s.util.E4Object
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LEN

public static final int LEN
See Also:
Constant Field Values

URL_EUROFXREF

public static final java.lang.String URL_EUROFXREF
Reference to EURO exchange rates.

See Also:
Constant Field Values

_DATATYPE

public static final E4DBColumnType _DATATYPE

C_EUR

public static final CurrencyCode C_EUR

C_USD

public static final CurrencyCode C_USD

C_JPY

public static final CurrencyCode C_JPY

C_BGN

public static final CurrencyCode C_BGN

C_CYP

public static final CurrencyCode C_CYP

C_CZK

public static final CurrencyCode C_CZK

C_DKK

public static final CurrencyCode C_DKK

C_EEK

public static final CurrencyCode C_EEK

C_GBP

public static final CurrencyCode C_GBP

C_HUF

public static final CurrencyCode C_HUF

C_LTL

public static final CurrencyCode C_LTL

C_LVL

public static final CurrencyCode C_LVL

C_MTL

public static final CurrencyCode C_MTL

C_PLN

public static final CurrencyCode C_PLN

C_RON

public static final CurrencyCode C_RON

C_SEK

public static final CurrencyCode C_SEK

C_SKK

public static final CurrencyCode C_SKK

C_CHF

public static final CurrencyCode C_CHF

C_ISK

public static final CurrencyCode C_ISK

C_NOK

public static final CurrencyCode C_NOK

C_HRK

public static final CurrencyCode C_HRK

C_RUB

public static final CurrencyCode C_RUB

C_TRY

public static final CurrencyCode C_TRY

C_AUD

public static final CurrencyCode C_AUD

C_CAD

public static final CurrencyCode C_CAD

C_CNY

public static final CurrencyCode C_CNY

C_HKD

public static final CurrencyCode C_HKD

C_IDR

public static final CurrencyCode C_IDR

C_KRW

public static final CurrencyCode C_KRW

C_MYR

public static final CurrencyCode C_MYR

C_NZD

public static final CurrencyCode C_NZD

C_PHP

public static final CurrencyCode C_PHP

C_SGD

public static final CurrencyCode C_SGD

C_THB

public static final CurrencyCode C_THB

C_ZAR

public static final CurrencyCode C_ZAR

C_TRL

public static final CurrencyCode C_TRL

CURRENCY_EUR_SYMBOL

public static final java.lang.String CURRENCY_EUR_SYMBOL
Defines the string for EUR "€" (€).

See Also:
Constant Field Values

CURRENCY_GBP_SYMBOL

public static final java.lang.String CURRENCY_GBP_SYMBOL
Defines the string for GBP "£" (£).

See Also:
Constant Field Values

CURRENCY_USD_SYMBOL

public static final java.lang.String CURRENCY_USD_SYMBOL
Defines the string for USD "$"

See Also:
Constant Field Values

CURRENCY_JPY_SYMBOL

public static final java.lang.String CURRENCY_JPY_SYMBOL
Defines the string for JPY "¥" (¥)

See Also:
Constant Field Values
Constructor Detail

CurrencyCode

public CurrencyCode(java.lang.String initval)

CurrencyCode

public CurrencyCode(E4String initval)

CurrencyCode

public CurrencyCode(java.lang.StringBuffer initval)

CurrencyCode

public CurrencyCode(char[] initval)
Method Detail

getName

public static E4Label_Intf getName(CurrencyCode code)
Get the associated english name for a currency code.

Parameters:
code - the currency-code which name is required.
Returns:
null if the code is not known or a name

getSymbol

public java.lang.String getSymbol()
Get the associated symbol ($, €, ..) for this currency code, if defined.

Parameters:
code - the currency-code which name is required
Returns:
the null if the code is not known or the symbol if it is defined
See Also:
CURRENCY_EUR_SYMBOL, CURRENCY_GBP_SYMBOL, CURRENCY_USD_SYMBOL, CURRENCY_JPY_SYMBOL

getSymbol

public static java.lang.String getSymbol(CurrencyCode code)
Get the associated symbol ($, €, ..) for a currency code, if defined.

Parameters:
code - the currency-code which name is required
Returns:
the null if the code is not known or the symbol if it is defined
See Also:
CURRENCY_EUR_SYMBOL, CURRENCY_GBP_SYMBOL, CURRENCY_USD_SYMBOL, CURRENCY_JPY_SYMBOL

getSymbolOrCode

public static java.lang.String getSymbolOrCode(CurrencyCode code)
If available, uses a currency symbol such as the DOllar-, Euro, Yen- Sign and if not, uses the currency-code.

See Also:
getSymbol(), getCurrencyCode()

getRate

public static float getRate(CurrencyCode code)
Get the current exchange rate to EURO issued by the EZB.

Parameters:
code - the currency-code which rate is required
Returns:
Float.NaN if not available or the price of the currency in EURO.

getCurrencySelection

public static E4SelectValues getCurrencySelection(CurrencyCode[] filtered)
Get a country selection for all the countries listed in the specified array.

Parameters:
filtered - an array of countries
Returns:
a Vector of E4SelectValues.OPTION elements.
See Also:
getCountrySelection(boolean), getCountrySelection()

getCurrencySelection

public static E4SelectValues getCurrencySelection()

init

public static void init()

getUsage

public static E4DBTypeUsage[] getUsage()
Returns null, only for compatibility reasons.

Returns:
null (always).

getCurrencyCode

public java.lang.String getCurrencyCode()
Get the county code, same as E4String.getString().

Returns:
the currency code, e.g. "EUR" for EURO.

getName

public E4Label_Intf getName()
Get the name associated with this currency code.

Returns:
the name

getPicture

public java.lang.String getPicture()
Deprecated. 

See Also:
getSymbol()

getSymbolOrCode

public java.lang.String getSymbolOrCode()
If available, uses a currency symbol such as the DOllar-, Euro, Yen- Sign and if not, uses the currency-code.

See Also:
getSymbol(), getCurrencyCode()

getRate

public float getRate()
Get the current exchange rate to EURO issued by the EZB.

Returns:
Float.NaN if not available or the price of the currency in EURO.

getCurrencies

public static CurrencyCode.CURRENCY[] getCurrencies()
Get an array of country definitions - including ISO code, name and flag if defined.

Returns:
the array with countries

newInstance

public static CurrencyCode newInstance(java.lang.String string)
Make an instance of a country code or return null if the specified value is null.

Parameters:
string - the value
Returns:
null or a new CountryCode

getLastSyncDate

public static java.util.Date getLastSyncDate()
Date and Time of last synchronization with EZB.

See Also:
getRate()

getRate

public static float getRate(CurrencyCode from,
                            CurrencyCode to)
Get the exchange rate of one currency into another.

Parameters:
from - the origin currency
to - the target currency
Returns:
Float.NaN if either one of the currency rates is not present or the exchange rate of the second (to) currency divided by the exchange rate of the from (from) currency.

addLegend

public static void addLegend(E4HtmlContentElement element,
                             E4ApplObj_Intf applobj)

_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com