jgnash.engine
Class ExchangeRate

java.lang.Object
  extended by jgnash.engine.StoredObject
      extended by jgnash.engine.ExchangeRate
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ExchangeRate
extends StoredObject

Exchange rate object

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

Field Summary
private  java.util.List<ExchangeRateHistoryNode> historyNodes
           
private  java.math.BigDecimal lastRate
          Cache the last exchange rate
private  java.util.concurrent.locks.ReadWriteLock lock
          ReadWrite lock
private  java.lang.String rateId
          Identifier for the ExchangeRate object
private static long serialVersionUID
           
 
Constructor Summary
  ExchangeRate()
          Deprecated.  
protected ExchangeRate(java.lang.String rateId)
           
 
Method Summary
(package private)  boolean addHistoryNode(ExchangeRateHistoryNode node)
           
 boolean contains(ExchangeRateHistoryNode node)
           
 boolean equals(java.lang.Object other)
          Default equals override
 java.util.List<ExchangeRateHistoryNode> getHistory()
           
private  java.util.concurrent.locks.ReadWriteLock getLock()
           
 java.math.BigDecimal getRate()
           
 java.lang.String getRateId()
           
 int hashCode()
          Override hashCode to use uuid
(package private)  boolean removeHistoryNode(ExchangeRateHistoryNode hNode)
           
 
Methods inherited from class jgnash.engine.StoredObject
clone, getUuid, isMarkedForRemoval, setMarkedForRemoval
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

historyNodes

private java.util.List<ExchangeRateHistoryNode> historyNodes

lastRate

private transient java.math.BigDecimal lastRate
Cache the last exchange rate


rateId

private java.lang.String rateId
Identifier for the ExchangeRate object


lock

private transient java.util.concurrent.locks.ReadWriteLock lock
ReadWrite lock

Constructor Detail

ExchangeRate

@Deprecated
public ExchangeRate()
Deprecated. 

No argument constructor for reflection purposes. Do not use to create a new instance


ExchangeRate

protected ExchangeRate(java.lang.String rateId)
Method Detail

getLock

private java.util.concurrent.locks.ReadWriteLock getLock()

contains

public boolean contains(ExchangeRateHistoryNode node)

getHistory

public java.util.List<ExchangeRateHistoryNode> getHistory()

addHistoryNode

boolean addHistoryNode(ExchangeRateHistoryNode node)

removeHistoryNode

boolean removeHistoryNode(ExchangeRateHistoryNode hNode)

getRateId

public java.lang.String getRateId()

getRate

public java.math.BigDecimal getRate()

equals

public boolean equals(java.lang.Object other)
Description copied from class: StoredObject
Default equals override

Overrides:
equals in class StoredObject
Parameters:
other - object to compare
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Description copied from class: StoredObject
Override hashCode to use uuid

Overrides:
hashCode in class StoredObject
See Also:
Object.hashCode()