Holger's
Java API

com.antelmann.math
Class CurrencyUnit

java.lang.Object
  extended by com.antelmann.math.DefaultUnit
      extended by com.antelmann.math.CurrencyUnit
All Implemented Interfaces:
Unit, Localizable, Wrapped<Currency>, Serializable

public class CurrencyUnit
extends DefaultUnit
implements Wrapped<Currency>

a wrapper that allows a currency to be treated as a unit

Since:
04.06.2009, 15:10:44
Author:
Holger Antelmann
See Also:
Money, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.antelmann.util.Localizable
Localizable.Adapter
 
Field Summary
 
Fields inherited from class com.antelmann.math.DefaultUnit
name, symbol
 
Constructor Summary
CurrencyUnit(Currency c)
          Deprecated. use asUnit(Currency) instead
 
Method Summary
static CurrencyUnit asUnit(Currency c)
          preferred method to obtain a CurrencyUnit instance, as it provides the same object for a currency
static CurrencyUnit fromSymbol(String symbol)
           
 Currency getCurrency()
           
 String getUnitSymbol()
          provides a short symbolic representation of this unit
 Currency unwrap()
          returns the embedded instance that this wrapper encloses
 
Methods inherited from class com.antelmann.math.DefaultUnit
equals, getLocale, getUnitName, hashCode, setLocale, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CurrencyUnit

@Deprecated
public CurrencyUnit(Currency c)
Deprecated. use asUnit(Currency) instead

See Also:
asUnit(Currency)
Method Detail

getCurrency

public Currency getCurrency()

getUnitSymbol

@Localized
public String getUnitSymbol()
Description copied from interface: Unit
provides a short symbolic representation of this unit

Specified by:
getUnitSymbol in interface Unit
Overrides:
getUnitSymbol in class DefaultUnit

unwrap

public Currency unwrap()
Description copied from interface: Wrapped
returns the embedded instance that this wrapper encloses

Specified by:
unwrap in interface Wrapped<Currency>

fromSymbol

public static CurrencyUnit fromSymbol(String symbol)

asUnit

public static CurrencyUnit asUnit(Currency c)
preferred method to obtain a CurrencyUnit instance, as it provides the same object for a currency



(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads