Package org.knowm.xchange.currency
Class Currency
java.lang.Object
org.knowm.xchange.currency.Currency
- All Implemented Interfaces:
Serializable
,Comparable<Currency>
public class Currency extends Object implements Comparable<Currency>, Serializable
A Currency class roughly modeled after
Currency
. Each object retains the code
it was acquired with -- so getInstance(java.lang.String)
("BTC").getCurrencyCode()
() will always be
"BTC", even though the proposed ISO 4217 code is "XBT"- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description int
compareTo(Currency o)
boolean
equals(Object obj)
static SortedSet<Currency>
getAvailableCurrencies()
Gets the set of available currencies.static SortedSet<String>
getAvailableCurrencyCodes()
Gets the set of available currency codes.Currency
getCodeCurrency(String code)
Gets the equivalent object with the passed code.Currency
getCommonlyUsedCurrency()
Gets the equivalent object that was created with the "commonly used" code.String
getCurrencyCode()
Gets the currency code originally used to acquire this object.Set<String>
getCurrencyCodes()
Gets the set of all currency codes associated with this currency.String
getDisplayName()
Gets the name that is suitable for displaying this currency.static Currency
getInstance(String currencyCode)
Returns a Currency instance for the given currency code.static Currency
getInstanceNoCreate(String currencyCode)
Returns the Currency instance for the given currency code only if one already exists.Currency
getIso4217Currency()
Gets the equivalent object with an ISO 4217 code, or if none a code which looks ISO compatible (starts with an X), or the constructed currency code if neither exist.String
getSymbol()
Gets the unicode symbol of this currency.int
hashCode()
String
toString()
-
Field Details
-
AED
Global currency codes -
AFN
-
ALL
-
AMD
-
ANC
-
ANG
-
AOA
-
ARN
-
ARS
-
ATOM
-
AUD
-
AUR
-
AVT
-
AWG
-
AZN
-
BAM
-
BAT
-
BBD
-
BC
-
BCC
-
BCH
-
BCA
-
BLK
-
BDT
-
BGC
-
BGN
-
BHD
-
BIF
-
BMD
-
BND
-
BOB
-
BRL
-
BRZ
-
BSD
-
BTC
-
BTG
-
XBT
-
BTN
-
BWP
-
BYR
-
BZD
-
CAD
-
CDF
-
CHF
-
CLF
-
CLP
-
CNC
-
CNY
-
COP
-
CRC
-
CUP
-
CVE
-
CZK
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
WTC
-
ORBS
-
HIVE
-
BSV
-
PAX
-
GXC
-
KNC
-
BUSD
-
CHR
-
HC
-
TT
-
EURS
-
HBAR
-
ONT
-
VGX
-
HOT
-
XZC
-
CELR
-
CKB
-
WICC
-
WAXP
-
BEAM
-
SXP
-
IOTX
-
VSYS
-
DATA
-
NIM
-
REQ
-
RIF
-
COMP
-
TMTG
-
ABBC
-
NAS
-
NANO
-
NMR
-
CRPT
-
DAD
-
MXC
-
TSHP
-
IOST
-
THETA
-
HUSD
-
COTI
-
PIVX
-
NULS
-
SOLVE
-
OKB
-
ZRX
-
-
Constructor Details
-
Currency
Public constructor. Links to an existing currency.
-
-
Method Details
-
getAvailableCurrencies
Gets the set of available currencies. -
getAvailableCurrencyCodes
Gets the set of available currency codes. -
getInstance
Returns a Currency instance for the given currency code. -
getInstanceNoCreate
Returns the Currency instance for the given currency code only if one already exists. -
getCurrencyCode
Gets the currency code originally used to acquire this object. -
getCodeCurrency
Gets the equivalent object with the passed code.This is useful in case some currencies share codes, such that
getInstance(String)
may return the wrong currency.- Parameters:
code
- The code the returned object will evaluate to- Returns:
- A Currency representing the same currency but having the passed currency code
- Throws:
IllegalArgumentException
- if the passed code is not listed for this currency
-
getIso4217Currency
Gets the equivalent object with an ISO 4217 code, or if none a code which looks ISO compatible (starts with an X), or the constructed currency code if neither exist. -
getCommonlyUsedCurrency
Gets the equivalent object that was created with the "commonly used" code. -
getCurrencyCodes
Gets the set of all currency codes associated with this currency. -
getSymbol
Gets the unicode symbol of this currency. -
getDisplayName
Gets the name that is suitable for displaying this currency. -
toString
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Currency>
-