junit.samples.money
クラス Money

java.lang.Object
  拡張junit.samples.money.Money
すべての実装インタフェース:
IMoney

public class Money
extends java.lang.Object
implements IMoney

A simple Money.


コンストラクタの概要
Money(int amount, java.lang.String currency)
          Constructs a money from the given amount and currency.
 
メソッドの概要
 IMoney add(IMoney m)
          Adds a money to this money.
 IMoney addMoney(Money m)
          Adds a simple Money to this money.
 IMoney addMoneyBag(junit.samples.money.MoneyBag s)
          Adds a MoneyBag to this money.
 int amount()
           
 void appendTo(junit.samples.money.MoneyBag m)
          Append this to a MoneyBag m.
 java.lang.String currency()
           
 boolean equals(java.lang.Object anObject)
           
 int hashCode()
           
 boolean isZero()
          Tests whether this money is zero
 IMoney multiply(int factor)
          Multiplies a money by the given factor.
 IMoney negate()
          Negates this money.
 IMoney subtract(IMoney m)
          Subtracts a money from this money.
 java.lang.String toString()
           
 
クラス java.lang.Object から継承したメソッド
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

Money

public Money(int amount,
             java.lang.String currency)
Constructs a money from the given amount and currency.

メソッドの詳細

add

public IMoney add(IMoney m)
Adds a money to this money. Forwards the request to the addMoney helper.

定義:
インタフェース IMoney 内の add

addMoney

public IMoney addMoney(Money m)
インタフェース IMoney の記述:
Adds a simple Money to this money. This is a helper method for implementing double dispatch

定義:
インタフェース IMoney 内の addMoney

addMoneyBag

public IMoney addMoneyBag(junit.samples.money.MoneyBag s)
インタフェース IMoney の記述:
Adds a MoneyBag to this money. This is a helper method for implementing double dispatch

定義:
インタフェース IMoney 内の addMoneyBag

amount

public int amount()

currency

public java.lang.String currency()

equals

public boolean equals(java.lang.Object anObject)

hashCode

public int hashCode()

isZero

public boolean isZero()
インタフェース IMoney の記述:
Tests whether this money is zero

定義:
インタフェース IMoney 内の isZero

multiply

public IMoney multiply(int factor)
インタフェース IMoney の記述:
Multiplies a money by the given factor.

定義:
インタフェース IMoney 内の multiply

negate

public IMoney negate()
インタフェース IMoney の記述:
Negates this money.

定義:
インタフェース IMoney 内の negate

subtract

public IMoney subtract(IMoney m)
インタフェース IMoney の記述:
Subtracts a money from this money.

定義:
インタフェース IMoney 内の subtract

toString

public java.lang.String toString()

appendTo

public void appendTo(junit.samples.money.MoneyBag m)
インタフェース IMoney の記述:
Append this to a MoneyBag m.

定義:
インタフェース IMoney 内の appendTo


Copyright © 2001-2004 JUnit.org. All Rights Reserved.