本文整理了Java中java.util.Currency.<init>()
方法的一些代码示例,展示了Currency.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Currency.<init>()
方法的具体详情如下:
包路径:java.util.Currency
类名称:Currency
方法名:<init>
[英]Constructs a Currency
instance. The constructor is private so that we can insure that there's never more than one instance for a given currency.
[中]构造一个Currency
实例。构造函数是私有的,因此我们可以确保给定货币的实例不会超过一个。
代码示例来源:origin: robovm/robovm
/**
* Returns the {@code Currency} instance for the given ISO 4217 currency code.
* @throws IllegalArgumentException
* if the currency code is not a supported ISO 4217 currency code.
*/
public static Currency getInstance(String currencyCode) {
synchronized (codesToCurrencies) {
Currency currency = codesToCurrencies.get(currencyCode);
if (currency == null) {
currency = new Currency(currencyCode);
codesToCurrencies.put(currencyCode, currency);
}
return currency;
}
}
代码示例来源:origin: stackoverflow.com
function CurrencyList(){
var valid_currencies = ["EUR", "RON", "USD"];
currencies = [];
for(i in valid_currencies){
currencies[i] = new Currency(valid_currencies[i], 0);
}
}
代码示例来源:origin: stackoverflow.com
import javax.xml.bind.annotation.adapters.XmlAdapter;
public class CurrencyAdapter extends XmlAdapter<String, Currency>{
@Override
public Currency unmarshal(String v) throws Exception {
Currency c = new Currency();
c.type = v;
return c;
}
@Override
public String marshal(Currency v) throws Exception {
return v.type;
}
}
代码示例来源:origin: stackoverflow.com
Currency c1 = new Currency();
Currency c2 = new Currency();
c1.lessThan(c2); //will call Currency.lessThan method
代码示例来源:origin: stackoverflow.com
function CurrencyList(){
var valid_currencies = ["EUR", "RON", "USD"];
currencies = [];
for(i in valid_currencies){
currencies[i] = new Currency(valid_currencies[i], 0);
}
this.at = function(index){
return currencies[index];
}
}
function Currency(type, quantity){
this.type = type;
this.quantity = quantity;
}
代码示例来源:origin: stackoverflow.com
Dollar.prototype = new Currency();
Dollar.prototype.constructor = Dollar;
代码示例来源:origin: stackoverflow.com
assertEquals(new Currency("10,00 €"), new Currency(bon.getTotal()))
代码示例来源:origin: stackoverflow.com
@RequestMapping(value = "/currency", method = RequestMethod.GET)
public String currencyPage(Model model) {
model.addAttribute("currency", new Currency());
return "listCurr";
}
代码示例来源:origin: stackoverflow.com
public final static Currency US_DOLLAR = new Currency(java.util.Currency.getInstance(CURRENCY_CODE_USD), "840", 100, "US dollar");
public final static Currency HK_DOLLAR = new Currency(java.util.Currency.getInstance(CURRENCY_CODE_HKD), "344", 100, "Hong Kong dollar");
public final static Currency MALAYSIAN_RINGGIT = new Currency(java.util.Currency.getInstance(CURRENCY_CODE_MYR), "344", 100, "Malaysian ringgit", CURRENCY_SYMBOL_RM);
代码示例来源:origin: com.jtransc/jtransc-rt
public static Currency getInstance(String currencyCode) {
synchronized (codesToCurrencies) {
Currency currency = codesToCurrencies.get(currencyCode);
if (currency == null) {
currency = new Currency(currencyCode);
codesToCurrencies.put(currencyCode, currency);
}
return currency;
}
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* Returns the {@code Currency} instance for the given ISO 4217 currency code.
* @throws IllegalArgumentException
* if the currency code is not a supported ISO 4217 currency code.
*/
public static Currency getInstance(String currencyCode) {
synchronized (codesToCurrencies) {
Currency currency = codesToCurrencies.get(currencyCode);
if (currency == null) {
currency = new Currency(currencyCode);
codesToCurrencies.put(currencyCode, currency);
}
return currency;
}
}
代码示例来源:origin: MobiVM/robovm
/**
* Returns the {@code Currency} instance for the given ISO 4217 currency code.
* @throws IllegalArgumentException
* if the currency code is not a supported ISO 4217 currency code.
*/
public static Currency getInstance(String currencyCode) {
synchronized (codesToCurrencies) {
Currency currency = codesToCurrencies.get(currencyCode);
if (currency == null) {
currency = new Currency(currencyCode);
codesToCurrencies.put(currencyCode, currency);
}
return currency;
}
}
代码示例来源:origin: com.gluonhq/robovm-rt
/**
* Returns the {@code Currency} instance for the given ISO 4217 currency code.
* @throws IllegalArgumentException
* if the currency code is not a supported ISO 4217 currency code.
*/
public static Currency getInstance(String currencyCode) {
synchronized (codesToCurrencies) {
Currency currency = codesToCurrencies.get(currencyCode);
if (currency == null) {
currency = new Currency(currencyCode);
codesToCurrencies.put(currencyCode, currency);
}
return currency;
}
}
代码示例来源:origin: ibinti/bugvm
/**
* Returns the {@code Currency} instance for the given ISO 4217 currency code.
* @throws IllegalArgumentException
* if the currency code is not a supported ISO 4217 currency code.
*/
public static Currency getInstance(String currencyCode) {
synchronized (codesToCurrencies) {
Currency currency = codesToCurrencies.get(currencyCode);
if (currency == null) {
currency = new Currency(currencyCode);
codesToCurrencies.put(currencyCode, currency);
}
return currency;
}
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* Returns the {@code Currency} instance for the given ISO 4217 currency code.
* @throws IllegalArgumentException
* if the currency code is not a supported ISO 4217 currency code.
*/
public static Currency getInstance(String currencyCode) {
synchronized (codesToCurrencies) {
Currency currency = codesToCurrencies.get(currencyCode);
if (currency == null) {
currency = new Currency(currencyCode);
codesToCurrencies.put(currencyCode, currency);
}
return currency;
}
}
代码示例来源:origin: FlexoVM/flexovm
/**
* Returns the {@code Currency} instance for the given ISO 4217 currency code.
* @throws IllegalArgumentException
* if the currency code is not a supported ISO 4217 currency code.
*/
public static Currency getInstance(String currencyCode) {
synchronized (codesToCurrencies) {
Currency currency = codesToCurrencies.get(currencyCode);
if (currency == null) {
currency = new Currency(currencyCode);
codesToCurrencies.put(currencyCode, currency);
}
return currency;
}
}
代码示例来源:origin: stackoverflow.com
assertEquals("10,00 €", new Currency(bon.getTotal()).toString());
代码示例来源:origin: stackoverflow.com
Currency currency = new Currency();
currency.setId(rs.getInt("id"));
currency.setEUR(rs.getString("EUR"));
代码示例来源:origin: stackoverflow.com
Currency exchange = new Currency(exchangerate);
代码示例来源:origin: jtulach/bck2brwsr
instance = new Currency(currencyCode, defaultFractionDigits, numericCode);
instances.put(currencyCode, instance);
return instance;
内容来源于网络,如有侵权,请联系作者删除!