com.diasparsoftware.java.util
Class Money

java.lang.Object
  extended bycom.diasparsoftware.java.util.Money
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable

public class Money
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable, java.lang.Comparable

See Also:
Serialized Form

Field Summary
static Money ZERO
           
 
Constructor Summary
Money()
           
Money(int cents)
           
Money(int dollars, int cents)
           
Money(java.lang.String moneyAsString)
           
 
Method Summary
 Money add(Money augend)
           
static Money cents(int cents)
           
 java.lang.Object clone()
           
 int compareTo(java.lang.Object other)
           
static Money dollars(int dollars)
           
static Money dollars(int dollars, int cents)
           
 boolean equals(java.lang.Object other)
           
 int hashCode()
           
 int inCents()
           
 boolean isValid()
           
 Money multipliedBy(float times)
           
 Money multipliedBy(int times)
           
 Money negate()
           
static Money parse(java.lang.String moneyAsString)
           
 Money roundToNearestDollar()
           
 java.util.List split(int nWays)
           
 java.lang.String toString()
           
 boolean valueInCentsIs(int expected)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static Money ZERO
Constructor Detail

Money

public Money()

Money

public Money(int cents)

Money

public Money(int dollars,
             int cents)

Money

public Money(java.lang.String moneyAsString)
      throws java.text.ParseException
Method Detail

cents

public static Money cents(int cents)

dollars

public static Money dollars(int dollars)

dollars

public static Money dollars(int dollars,
                            int cents)

parse

public static Money parse(java.lang.String moneyAsString)

add

public Money add(Money augend)

clone

public java.lang.Object clone()

equals

public boolean equals(java.lang.Object other)

hashCode

public int hashCode()

inCents

public int inCents()

isValid

public boolean isValid()

multipliedBy

public Money multipliedBy(int times)

multipliedBy

public Money multipliedBy(float times)

negate

public Money negate()

roundToNearestDollar

public Money roundToNearestDollar()

split

public java.util.List split(int nWays)

toString

public java.lang.String toString()

valueInCentsIs

public boolean valueInCentsIs(int expected)

compareTo

public int compareTo(java.lang.Object other)
Specified by:
compareTo in interface java.lang.Comparable


Copyright © 2003-2004 Diaspar Software Services, Inc.. All Rights Reserved.