org.jbudget.util
Class CurrencyFormater

java.lang.Object
  extended by org.jbudget.util.CurrencyFormater

public class CurrencyFormater
extends java.lang.Object

Formats and parses amount of money to/from long values used as internal representation.

Author:
petrov

Field Summary
private static java.lang.String currencySymbol
          Currency symbol
private static ExpressionParser exprParser
          Expression Parser
private static java.text.NumberFormat formater
           
 
Constructor Summary
private CurrencyFormater()
          Creates a new instance of CurrencyFormater
 
Method Summary
static java.lang.String format(long amount)
          Returns a string representation of the amount
static long parse(java.lang.String amountStr)
          Parses a string into amount
static long parseExpression(java.lang.String exprString)
          Parses a string containing a math expression into amount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

formater

private static final java.text.NumberFormat formater

currencySymbol

private static final java.lang.String currencySymbol
Currency symbol


exprParser

private static final ExpressionParser exprParser
Expression Parser

Constructor Detail

CurrencyFormater

private CurrencyFormater()
Creates a new instance of CurrencyFormater

Method Detail

format

public static java.lang.String format(long amount)
Returns a string representation of the amount


parse

public static long parse(java.lang.String amountStr)
                  throws java.text.ParseException
Parses a string into amount

Throws:
java.text.ParseException

parseExpression

public static long parseExpression(java.lang.String exprString)
                            throws java.text.ParseException
Parses a string containing a math expression into amount

Throws:
java.text.ParseException