FileDocCategorySizeDatePackage
Account.javaAPI DocExample4614Sun Dec 14 22:47:42 GMT 2003oreilly.hcj.bankdata

Account

public abstract class Account extends oreilly.hcj.datamodeling.MutableObject
Base class for all customer accounts.
author
Robert Simmons jr. (kraythe)
version
$Revision: 1.4 $

Fields Summary
public static final oreilly.hcj.datamodeling.constraints.NumericConstraint
ID_CONSTRAINT
Constraint for the ID property.
public static final oreilly.hcj.datamodeling.constraints.ObjectConstraint
CUSTOMER_CONSTRAINT
Constraint for the customer property.
public static final oreilly.hcj.datamodeling.constraints.NumericConstraint
BALANCE_CONSTRAINT
Constraint for the balance property.
public static final oreilly.hcj.datamodeling.constraints.CollectionConstraint
TRANSACTION_LIST_CONSTRAINT
Constraint for the transactionList property.
private Customer
customer
The customer that holds this account.
private Float
balance
Balance on the account.
private Integer
ID
Holds value of property ID.
private Set
transactionList
The list of transactions executed on thsi account.
Constructors Summary
Methods Summary
public booleanequals(java.lang.Object obj)

see
java.lang.Object#equals(java.lang.Object)

		if (!(obj instanceof Account)) {
			return false;
		} else {
			return (((Account)obj).getID().equals(this.ID));
		}
	
public java.lang.FloatgetBalance()
Getter for property balance.

return
Value of property balance.

		return balance;
	
public CustomergetCustomer()
Getter for property customer.

return
Value of property customer.

		return customer;
	
public java.lang.IntegergetID()
Getter for property ID.

return
Value of property ID.

		return this.ID;
	
public java.util.SetgetTransactionList()
Getter for property transactionList.

return
Value of property transactionList.

		return Collections.unmodifiableSet(transactionList);
	
public inthashCode()

see
java.lang.Object#hashCode()

		return this.ID.hashCode();
	
public voidsetBalance(java.lang.Float balance)
Setter for property balance.

param
balance New value of property balance.


	// of type Transaction

	            	 
	     
		BALANCE_CONSTRAINT.validate(balance);
		final Float oldBalance = this.balance;
		this.balance = balance;
		propertyChangeSupport.firePropertyChange("balance", oldBalance, this.balance);
	
public voidsetCustomer(Customer customer)
Setter for property customer.

param
customer New value of property customer.

		this.customer = customer;
	
public voidsetID(java.lang.Integer ID)
Setter for property ID.

param
ID New value of property ID.

		ID_CONSTRAINT.validate(ID);
		final Integer oldID = this.ID;
		this.ID = ID;
		propertyChangeSupport.firePropertyChange("ID", oldID, ID);
	
public voidsetTransactionList(java.util.Set transactionList)
Setter for property transactionList.

param
transactionList New value of property transactionList.

		TRANSACTION_LIST_CONSTRAINT.validate(transactionList);
		final Set oldTransactionList = Collections.unmodifiableSet(this.transactionList);
		this.transactionList = new HashSet(transactionList);
		propertyChangeSupport.firePropertyChange("transactionList", oldTransactionList,
		                                         getTransactionList());