org.salespointframework.core.data.interfaces
Interface Currency<T extends CurrencyItem>

All Superinterfaces:
Catalog<T>, CatalogItem, java.lang.Comparable<java.lang.Object>, DataBasketEntryDestination, DataBasketEntrySource, DatasourceChangeListener, ExternalModificationListener, java.lang.Iterable<T>, Nameable, SpAggregate, SpItem
All Known Implementing Classes:
AbstractCurrency, CurrencyFilter, CurrencyImpl, EUROCurrencyImpl

public interface Currency<T extends CurrencyItem>
extends Catalog<T>

A special Catalog that represents a currency.

Currencies contain CurrencyItems and work together with MoneyBags. They are capable of parsing user input that is formatted according to the currency format for the specific currency they represent. It is recommended that you use a Locale specific algorithm for implementation, but this cannot be enforced.

Since:
v0.5
Version:
2.0 18/08/1999
Author:
Steffen Zschaler

Field Summary
 
Fields inherited from interface org.salespointframework.core.data.interfaces.CatalogItem
VALUE_PROPERTY
 
Fields inherited from interface org.salespointframework.core.data.interfaces.Nameable
NAME_PROPERTY
 
Method Summary
 NumberValue parse(java.lang.String s)
          Try to interpret the given String according to the currency format of the specific currency.
 java.lang.String toString(NumberValue nv)
          Convert the given value into a String representation according to the currency format of the specific currency.
 
Methods inherited from interface org.salespointframework.core.data.interfaces.Catalog
add, contains, get, iterator, keySet, remove, remove, size
 
Methods inherited from interface org.salespointframework.core.data.interfaces.CatalogItem
addValueListener, firePropertyChanged, getCatalog, getImage, getValue, removeValueListener, setImage
 
Methods inherited from interface org.salespointframework.core.data.interfaces.Nameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.salespointframework.core.data.interfaces.SpItem
getName
 
Methods inherited from interface org.salespointframework.core.data.events.DatasourceChangeListener
DatasourceChanged
 
Methods inherited from interface org.salespointframework.core.data.events.ExternalModificationListener
externalModificationOccurred
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

toString

java.lang.String toString(NumberValue nv)
Convert the given value into a String representation according to the currency format of the specific currency. nv must be given in the smallest unit of the currency, i.e. if you want to specify 5,05 DM nv should be 505.

Parameters:
nv - the value to be converted

parse

NumberValue parse(java.lang.String s)
                  throws java.text.ParseException
Try to interpret the given String according to the currency format of the specific currency.

Parameters:
s - the text to be parsed
Returns:
the interpreted value in the smallest unit of the currency.
Throws:
java.text.ParseException - if the input could not be parsed.