jgnash.engine
Class CurrencyNode

java.lang.Object
  extended by jgnash.engine.StoredObject
      extended by jgnash.engine.CommodityNode
          extended by jgnash.engine.CurrencyNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<CommodityNode>

public class CurrencyNode
extends CommodityNode

Class for representing currency nodes

Version:
$Id$
Author:
Craig Cavanaugh
See Also:
Serialized Form

Field Summary
private  ExchangeRateDAO exchangeRateDAO
           
private  java.util.Locale locale
           
private static long serialVersionUID
           
 
Constructor Summary
CurrencyNode()
           
 
Method Summary
 int compareTo(CommodityNode node)
           
 java.math.BigDecimal getExchangeRate(CurrencyNode exchangeCurrency)
          Returns an exchange rate given a currency to convert to.
private  ExchangeRateDAO getExchangeRateDAO()
           
 java.util.Locale getLocale()
           
 boolean matches(CommodityNode other)
          Determines if given node matches this node.
(package private)  void setExchangeRateDAO(ExchangeRateDAO exchangeRateStore)
           
 void setLocale(java.util.Locale locale)
           
 
Methods inherited from class jgnash.engine.CommodityNode
equals, getDescription, getPrefix, getScale, getSuffix, getSymbol, hashCode, round, setDescription, setPrefix, setScale, setSuffix, setSymbol, toString
 
Methods inherited from class jgnash.engine.StoredObject
clone, getUuid, isMarkedForRemoval, setMarkedForRemoval
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

locale

private java.util.Locale locale

exchangeRateDAO

private transient ExchangeRateDAO exchangeRateDAO
Constructor Detail

CurrencyNode

public CurrencyNode()
Method Detail

setLocale

public void setLocale(java.util.Locale locale)

getLocale

public java.util.Locale getLocale()

matches

public boolean matches(CommodityNode other)
Determines if given node matches this node. The UUID is not used for comparison

Overrides:
matches in class CommodityNode
Parameters:
other - CurrencyNode to compare against
Returns:
true if objects match

compareTo

public int compareTo(CommodityNode node)
Specified by:
compareTo in interface java.lang.Comparable<CommodityNode>
Overrides:
compareTo in class CommodityNode

getExchangeRateDAO

private ExchangeRateDAO getExchangeRateDAO()
Returns:
the exchangeRateStore

setExchangeRateDAO

void setExchangeRateDAO(ExchangeRateDAO exchangeRateStore)
Parameters:
exchangeRateStore - the exchangeRateStore to set

getExchangeRate

public java.math.BigDecimal getExchangeRate(CurrencyNode exchangeCurrency)
Returns an exchange rate given a currency to convert to.

Parameters:
exchangeCurrency - currency to convert to
Returns:
exchange rate