SalesPoint Framework v3.0

data
Interface Currency

All Known Implementing Classes:
CurrencyFilter, CurrencyImpl

public interface Currency
extends Catalog

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.

Hooks:
Define Currency Filter
Since:
v0.5
Version:
2.0 18/08/1999
Author:
Steffen Zschaler

Fields inherited from class data.CatalogItem
VALUE_PROPERTY
 
Fields inherited from class data.Nameable
NAME_PROPERTY
 
Method Summary
 NumberValue parse(String s)
          Try to interpret the given String according to the currency format of the specific currency.
 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 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
 

Method Detail

toString

public 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.
Override:
Always.
Parameters:
nv - the value to be converted

parse

public NumberValue parse(String s)
                  throws ParseException
Try to interpret the given String according to the currency format of the specific currency.
Override:
Always.
Parameters:
s - the text to be parsed
Returns:
the interpreted value in the smallest unit of the currency.
Throws:
ParseException - if the input could not be parsed.

SalesPoint Framework v3.0