jfreerails.world.accounts
Class AddItemTransaction

java.lang.Object
  extended by jfreerails.world.accounts.AddItemTransaction
All Implemented Interfaces:
java.io.Serializable, Transaction, FreerailsSerializable
Direct Known Subclasses:
BondTransaction, StockTransaction

public class AddItemTransaction
extends java.lang.Object
implements Transaction

This Transaction represents the charge/credit for buying/selling an item.

Author:
Luke Lindsay
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface jfreerails.world.accounts.Transaction
Transaction.Category
 
Field Summary
private  Money amount
           
private  Transaction.Category category
          For example track.
private  int quantity
          For example, 4 tiles.
private static long serialVersionUID
           
private  int type
          For example, standard track.
 
Constructor Summary
AddItemTransaction(Transaction.Category category, int type, int quantity, Money amount)
           
 
Method Summary
 Money deltaAssets()
           
 Money deltaCash()
          Positive means credit.
 boolean equals(java.lang.Object obj)
           
 Transaction.Category getCategory()
           
 int getQuantity()
           
 int getType()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

amount

private final Money amount

category

private final Transaction.Category category
For example track.


quantity

private final int quantity
For example, 4 tiles.


type

private final int type
For example, standard track.

Constructor Detail

AddItemTransaction

public AddItemTransaction(Transaction.Category category,
                          int type,
                          int quantity,
                          Money amount)
Method Detail

deltaAssets

public Money deltaAssets()
Specified by:
deltaAssets in interface Transaction

deltaCash

public Money deltaCash()
Description copied from interface: Transaction
Positive means credit.

Specified by:
deltaCash in interface Transaction

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getCategory

public Transaction.Category getCategory()
Specified by:
getCategory in interface Transaction

getQuantity

public int getQuantity()

getType

public int getType()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object