Java Reference
In-Depth Information
if (dbConn != null) {
// We have a database connection.
} else {
// We don't and we must create a top account.
}
return topAccount;
}
// Simple getter; returns the name.
public String
getName() { return name; }
// Simple getter; returns the total pool of money that this account represents.
public SAMoney
getTotal() { return total; }
// Simple getter; returns the balance.
public SAMoney
getBalance() { return balance; }
// Simple getter; returns the parent account.
public Account
getParent() { return parent; }
// Simple getter; returns the owner of this account, as a User object.
public User
getOwner() { return owner; }
// Census - how many children.
public int
size() { return children.size(); }
/**
* Get to all the children, via an iterator.
*/
public Iterator
getAllSubs()
{
return children.values().iterator();
}
/**
* Create a new subaccount (i.e., child)
* given a name and an amount.
* The child is connected to the parent, and
* the parent's balance is reduced by the amount
* allocated to the child.
*/
Search WWH ::




Custom Search