org.boxed_economy.besp.model.fmfw
クラス GoodsQuantity

java.lang.Object
  拡張org.boxed_economy.besp.model.fmfw.GoodsQuantity
すべての実装インタフェース:
java.io.Serializable

public class GoodsQuantity
extends java.lang.Object
implements java.io.Serializable

Goodsの量を定義します。quantityとして操作を行なうためのadd・remove・equals(同じquantityであるかの比較) 比較を行なうことができます。値をdoubleとして持っています。 あくまでもgoodsのquantityを表すクラスとしておくために、setquantityは実装しません。

バージョン:
$Id: GoodsQuantity.java,v 1.2 2004/03/21 20:07:07 macchan Exp $
作成者:
macchan
関連項目:
直列化された形式

コンストラクタの概要
GoodsQuantity(double value)
          コンストラクタです。
 
メソッドの概要
 GoodsQuantity add(GoodsQuantity target)
          このgoodsのquantityに引数のGoodsQuantityを足したGoodsQuantityを返します。
 int compareTo(java.lang.Object goodsquantity)
          どちらが多いか比較します。
 boolean equals(java.lang.Object goodsquantity)
          引数のGoodsQuantityとの比較をおこないます。
 double getValueAsDouble()
          浮動小数点数でquantityのvalueを返します。
 java.lang.Double getValueAsDoubleObject()
          浮動小数点数オブジェクトでquantityのvalueを返します。
 int getValueAsInt()
          整数でquantityのvalueを返します。
 java.lang.Integer getValueAsIntegerObject()
          整数オブジェクトでquantityのvalueを返します。
 GoodsQuantity remove(GoodsQuantity target)
          現在のgoodsのquantityから引数のGoodsQuantityを引いたGoodsQuantityを返します。
 
クラス java.lang.Object から継承したメソッド
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

GoodsQuantity

public GoodsQuantity(double value)
              throws ModelException
コンストラクタです。設定するgoodsのquantityを必ずdoubleで与えてください。

メソッドの詳細

getValueAsDouble

public double getValueAsDouble()
浮動小数点数でquantityのvalueを返します。

戻り値:
quantity

getValueAsInt

public int getValueAsInt()
整数でquantityのvalueを返します。

戻り値:
quantity

getValueAsDoubleObject

public java.lang.Double getValueAsDoubleObject()
浮動小数点数オブジェクトでquantityのvalueを返します。

戻り値:
quantity

getValueAsIntegerObject

public java.lang.Integer getValueAsIntegerObject()
整数オブジェクトでquantityのvalueを返します。

戻り値:
quantity

equals

public boolean equals(java.lang.Object goodsquantity)
引数のGoodsQuantityとの比較をおこないます。

パラメータ:
goodsquantity - 比較のtarget
戻り値:
同じかどうかの真偽

compareTo

public int compareTo(java.lang.Object goodsquantity)
どちらが多いか比較します。

パラメータ:
goodsquantity - 比較target
戻り値:
比較結果

add

public GoodsQuantity add(GoodsQuantity target)
このgoodsのquantityに引数のGoodsQuantityを足したGoodsQuantityを返します。

パラメータ:
target - 加算するtarget
戻り値:
加算結果

remove

public GoodsQuantity remove(GoodsQuantity target)
現在のgoodsのquantityから引数のGoodsQuantityを引いたGoodsQuantityを返します。 もし、removeのquantityの方が多ければ、removeすることはできず、ModelExceptionを返します。

パラメータ:
target - 減算をするtarget
戻り値:
減算結果