com.jacob.com
Class Currency

java.lang.Object
  extended by com.jacob.com.Currency

public class Currency
extends Object

Most COM bridges use java.lang.Long as their Java data type for COM Currency data. This is because COM currency is a 64 bit number where the last 4 digits represent the milli-cents. We wanted to support 64 bit Long values for x64 platforms so that meant we wanted to map Java.LONG to COM.LONG even though it only works for 64 bit platforms. The end result was we needed a new representation for Money so we have this.

In the future, this should convert to and from BigDecimal or Double


Constructor Summary
Currency(long newValue)
          constructor that takes a long already in COM representation
Currency(String newValue)
          constructor that takes a String already in COM representation
 
Method Summary
 int compareTo(Currency anotherCurrency)
          compares the values of two currencies
 int compareTo(Object o)
          standard comparison
 boolean equals(Object o)
          
protected  Long getLongValue()
          getter to the inner storage so that cmpareTo can work
 long longValue()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Currency

public Currency(long newValue)
constructor that takes a long already in COM representation

Parameters:
newValue -

Currency

public Currency(String newValue)
constructor that takes a String already in COM representation

Parameters:
newValue -
Method Detail

longValue

public long longValue()
Returns:
the currency as a primitive long

getLongValue

protected Long getLongValue()
getter to the inner storage so that cmpareTo can work

Returns:
the embedded long value

compareTo

public int compareTo(Currency anotherCurrency)
compares the values of two currencies

Parameters:
anotherCurrency -
Returns:
the usual compareTo results

compareTo

public int compareTo(Object o)
standard comparison

Parameters:
o - must be Currency or Long
Returns:
the usual compareTo results

equals

public boolean equals(Object o)

Overrides:
equals in class Object


http://jacob-project.sourceforge.net