jfreerails.world.accounts
Class StockTransaction

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

public class StockTransaction
extends AddItemTransaction

A transaction that occurs when a new company is founded or when a company issues additional shares.

Author:
Luke, smackay
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface jfreerails.world.accounts.Transaction
Transaction.Category
 
Field Summary
private static long serialVersionUID
           
static int STOCK_BUNDLE_SIZE
           
 
Constructor Summary
private StockTransaction(int quantity, Money amount)
           
private StockTransaction(Transaction.Category category, int playerId, int quantity, Money amount)
           
 
Method Summary
static StockTransaction buyOrSellStock(int playerId, int quantity, Money stockPrice)
           
static StockTransaction issueStock(int playerId, int quantity, Money pricePerShare)
           
static StockTransaction issueStock(int quantity, long pricePerShare)
           
 
Methods inherited from class jfreerails.world.accounts.AddItemTransaction
deltaAssets, deltaCash, equals, getCategory, getQuantity, getType, hashCode, 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

STOCK_BUNDLE_SIZE

public static final int STOCK_BUNDLE_SIZE
See Also:
Constant Field Values
Constructor Detail

StockTransaction

private StockTransaction(Transaction.Category category,
                         int playerId,
                         int quantity,
                         Money amount)

StockTransaction

private StockTransaction(int quantity,
                         Money amount)
Method Detail

issueStock

public static StockTransaction issueStock(int playerId,
                                          int quantity,
                                          Money pricePerShare)

buyOrSellStock

public static StockTransaction buyOrSellStock(int playerId,
                                              int quantity,
                                              Money stockPrice)

issueStock

public static StockTransaction issueStock(int quantity,
                                          long pricePerShare)