org.neuclear.ledger
Class UnPostedTransaction
java.lang.Object
org.neuclear.ledger.Transaction
org.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
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnPostedTransaction
public UnPostedTransaction(java.lang.String ledger,
java.lang.String req,
java.lang.String comment)
throws InvalidTransactionException
- 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
- Parameters:
ledger - comment -
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:
- Transaction must not have been posted already
- Book must not be null
- Book must be from the same Ledger as the Transaction
- Parameters:
book - amount -
- Returns:
- the new balance
- Throws:
InvalidTransactionException
Copyright © 2003-2004 Antilles Software Ventures SA. All Rights Reserved.