org.neuclear.ledger
Class UnPostedTransaction

java.lang.Object
  extended byorg.neuclear.ledger.Transaction
      extended byorg.neuclear.ledger.UnPostedTransaction
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
UnPostedHeldTransaction

public class UnPostedTransaction
extends Transaction

Class for building Transactions

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.neuclear.ledger.Transaction
items, ledger
 
Constructor Summary
UnPostedTransaction(java.lang.String ledger, java.lang.String req, java.lang.String comment)
          Basic rules for creating Transactions: Ledger must not be null transactionTime must not be null if there is an expiryTime it must not be before the transactionTime
 
Method Summary
 double addItem(Book book, double amount)
          Adds an item to an unposted Transaction.
 double getBalance()
          Get the balance of the Transaction.
 boolean isBalanced()
          Is the Transaction Balanced
 
Methods inherited from class org.neuclear.ledger.Transaction
getAmount, getComment, getItemList, getItems, getLedger, getRequestId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnPostedTransaction

public UnPostedTransaction(java.lang.String ledger,
                           java.lang.String req,
                           java.lang.String comment)
                    throws InvalidTransactionException
Basic rules for creating Transactions:

Parameters:
ledger -
comment -
Method Detail

isBalanced

public final boolean isBalanced()
Is the Transaction Balanced

Returns:

getBalance

public final double getBalance()
Get the balance of the Transaction. This should be 0 for posting.

Returns:

addItem

public final double addItem(Book book,
                            double amount)
                     throws InvalidTransactionException
Adds an item to an unposted Transaction. Basic Rules for Items:

Parameters:
book -
amount -
Returns:
the new balance
Throws:
InvalidTransactionException


Copyright © 2003-2004 Antilles Software Ventures SA. All Rights Reserved.