SalesPoint Framework v3.1

data.ooimpl
Class CurrencyImpl

java.lang.Object
  extended bydata.AbstractNameable
      extended bydata.ooimpl.CatalogItemImpl
          extended bydata.ooimpl.CatalogImpl
              extended bydata.ooimpl.CurrencyImpl
All Implemented Interfaces:
Catalog, CatalogItem, Cloneable, Comparable, Currency, DataBasketEntryDestination, DataBasketEntrySource, DataBasketKeys, ListenableCatalog, Nameable, NameContext, SelfManagingDBEDestination, SelfManagingDBESource, Serializable

public class CurrencyImpl
extends CatalogImpl
implements Currency

Pure Java implementation of the Currency interface.

Since:
v2.0
Author:
Steffen Zschaler
See Also:
Serialized Form

Field Summary
static String DM_SCHEIN_10
          Field string represents the mainkey for an added CurrencyItemImpl.
static String DM_SCHEIN_100
          Field string represents the mainkey for an added CurrencyItemImpl.
static String DM_SCHEIN_1000
          Field string represents the mainkey for an added CurrencyItemImpl.
static String DM_SCHEIN_20
          Field string represents the mainkey for an added CurrencyItemImpl.
static String DM_SCHEIN_200
          Field string represents the mainkey for an added CurrencyItemImpl.
static String DM_SCHEIN_5
          Field string represents the mainkey for an added CurrencyItemImpl.
static String DM_SCHEIN_50
          Field string represents the mainkey for an added CurrencyItemImpl.
static String DM_SCHEIN_500
          Field string represents the mainkey for an added CurrencyItemImpl.
static String DM_STCK_1
          Field string represents the mainkey for an added CurrencyItemImpl.
static String DM_STCK_10
          Field string represents the mainkey for an added CurrencyItemImpl.
static String DM_STCK_2
          Field string represents the mainkey for an added CurrencyItemImpl.
static String DM_STCK_5
          Field string represents the mainkey for an added CurrencyItemImpl.
static String PFENNIG_STCK_1
          Field string represents the mainkey for an added CurrencyItemImpl.
static String PFENNIG_STCK_10
          Field string represents the mainkey for an added CurrencyItemImpl.
static String PFENNIG_STCK_2
          Field string represents the mainkey for an added CurrencyItemImpl.
static String PFENNIG_STCK_5
          Field string represents the mainkey for an added CurrencyItemImpl.
static String PFENNIG_STCK_50
          Field string represents the mainkey for an added CurrencyItemImpl.
 
Fields inherited from class data.ooimpl.CatalogImpl
m_lhListeners, m_nModCount
 
Fields inherited from class data.AbstractNameable
m_ncContext, m_pcsPropertyListeners
 
Fields inherited from interface data.CatalogItem
VALUE_PROPERTY
 
Fields inherited from interface data.Nameable
NAME_PROPERTY
 
Fields inherited from interface data.DataBasketKeys
CATALOG_ITEM_MAIN_KEY, STOCK_ITEM_MAIN_KEY
 
Constructor Summary
CurrencyImpl(String sName)
          Create a new CurrencyImpl with a default locale of Locale.GERMANY and fill it.
CurrencyImpl(String sName, Locale l)
          Create a new, initially empty CurrencyImpl for the given locale.
 
Method Summary
 NumberValue parse(String s)
          Try to parse the given String as a currency value in the currency's associated format.
 String toString(NumberValue nv)
          Return a String representation of the given NumberValue assuming it is a value given in the smallest unit of this currency.
 
Methods inherited from class data.ooimpl.CatalogImpl
add, addCatalogChangeListener, checkNameChange, commitAdd, commitRemove, contains, createPeer, fireCanEditCatalogItem, fireCanRemoveCatalogItem, fireCatalogItemAddCommit, fireCatalogItemAdded, fireCatalogItemAddRollback, fireCatalogItemRemoveCommit, fireCatalogItemRemoved, fireCatalogItemRemoveRollback, fireCommitEditCatalogItem, fireEditingCatalogItem, fireRollbackEditCatalogItem, get, getEditableCopy, getEditingItemsContainer, getItemsContainer, getItemsLock, getNCMonitor, getShallowClone, getTemporaryAddedItemsContainer, getTemporaryRemovedItemsContainer, iterator, keySet, nameHasChanged, remove, remove, removeCatalogChangeListener, rollbackAdd, rollbackRemove, size, toString
 
Methods inherited from class data.ooimpl.CatalogItemImpl
addValueListener, compareTo, equals, getCatalog, getValue, isEditable, removeValueListener, setValue
 
Methods inherited from class data.AbstractNameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface data.Catalog
add, contains, get, iterator, keySet, remove, remove, size
 
Methods inherited from interface data.CatalogItem
addValueListener, getCatalog, getValue, removeValueListener
 
Methods inherited from interface data.Nameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

PFENNIG_STCK_1

public static String PFENNIG_STCK_1
Field string represents the mainkey for an added CurrencyItemImpl.

1-Pfennig-Stueck


PFENNIG_STCK_2

public static String PFENNIG_STCK_2
Field string represents the mainkey for an added CurrencyItemImpl.

2-Pfennig-Stueck


PFENNIG_STCK_5

public static String PFENNIG_STCK_5
Field string represents the mainkey for an added CurrencyItemImpl.

5-Pfennig-Stueck


PFENNIG_STCK_10

public static String PFENNIG_STCK_10
Field string represents the mainkey for an added CurrencyItemImpl.

10-Pfennig-Stueck


PFENNIG_STCK_50

public static String PFENNIG_STCK_50
Field string represents the mainkey for an added CurrencyItemImpl.

50-Pfennig-Stueck


DM_STCK_1

public static String DM_STCK_1
Field string represents the mainkey for an added CurrencyItemImpl.

1-Mark-Stueck


DM_STCK_2

public static String DM_STCK_2
Field string represents the mainkey for an added CurrencyItemImpl.

2-Mark-Stueck


DM_STCK_5

public static String DM_STCK_5
Field string represents the mainkey for an added CurrencyItemImpl.

5-Mark-Stueck


DM_SCHEIN_5

public static String DM_SCHEIN_5
Field string represents the mainkey for an added CurrencyItemImpl.

5-Mark-Schein


DM_STCK_10

public static String DM_STCK_10
Field string represents the mainkey for an added CurrencyItemImpl.

10-Mark-Stueck


DM_SCHEIN_10

public static String DM_SCHEIN_10
Field string represents the mainkey for an added CurrencyItemImpl.

10-Mark-Schein


DM_SCHEIN_20

public static String DM_SCHEIN_20
Field string represents the mainkey for an added CurrencyItemImpl.

20-Mark-Schein


DM_SCHEIN_50

public static String DM_SCHEIN_50
Field string represents the mainkey for an added CurrencyItemImpl.

50-Mark-Schein


DM_SCHEIN_100

public static String DM_SCHEIN_100
Field string represents the mainkey for an added CurrencyItemImpl.

100-Mark-Schein


DM_SCHEIN_200

public static String DM_SCHEIN_200
Field string represents the mainkey for an added CurrencyItemImpl.

200-Mark-Schein


DM_SCHEIN_500

public static String DM_SCHEIN_500
Field string represents the mainkey for an added CurrencyItemImpl.

500-Mark-Schein


DM_SCHEIN_1000

public static String DM_SCHEIN_1000
Field string represents the mainkey for an added CurrencyItemImpl.

1000-Mark-Schein

Constructor Detail

CurrencyImpl

public CurrencyImpl(String sName,
                    Locale l)
Create a new, initially empty CurrencyImpl for the given locale.

Parameters:
sName - the name of the currency to create.
l - the locale that determines how currency values will be formatted.

CurrencyImpl

public CurrencyImpl(String sName)
Create a new CurrencyImpl with a default locale of Locale.GERMANY and fill it.

The currency will already contain all denominations that are available in the DEM currency.

Parameters:
sName - the name of the new currency.
Method Detail

toString

public String toString(NumberValue nv)
Return a String representation of the given NumberValue assuming it is a value given in the smallest unit of this currency.

Specified by:
toString in interface Currency
Parameters:
nv - the value to be rendered.
Returns:
the formatted String representation
Override:
Never

parse

public NumberValue parse(String s)
                  throws ParseException
Try to parse the given String as a currency value in the currency's associated format.

Specified by:
parse in interface Currency
Parameters:
s - the text to be parsed.
Returns:
the value that was identified in the text, given in the smallest unit of this currency.
Throws:
ParseException - if the given String could not be interpreted as a currency value.
Override:
Never

SalesPoint Framework v3.1