finished basic account add
[Bookkeeping.git] / src / com / interrupt / bookkeeping / Bookkeeping.java
blobf63b9bf3245499f13da01a824dced60089b1e026
1 package com.interrupt.bookkeeping;
3 import java.util.List;
5 import com.interrupt.bookkeeping.journal.IJournals;
8 public class Bookkeeping extends GBookkeeping {
11 private com.interrupt.bookkeeping.account.IAccounts accounts = null;
12 private com.interrupt.bookkeeping.journal.IJournals journals = null;
13 private com.interrupt.bookkeeping.journal.ITransactions transactions = null;
15 public Bookkeeping() {
17 accounts = new com.interrupt.bookkeeping.account.Accounts();
18 accounts.setParent(this);
20 journals = new com.interrupt.bookkeeping.journal.Journals();
21 journals.setParent(this);
23 transactions = new com.interrupt.bookkeeping.journal.Transactions();
24 transactions.setParent(this);
28 // Allow 1 Accounts, Journals, Transaction per 'Bookkeeping'
29 // As well, the 'remove' methods are not meant to be used
31 // Accounts
32 public com.interrupt.bookkeeping.account.IAccounts findAccountsById(String value) {
33 return accounts;
35 public com.interrupt.bookkeeping.account.IAccounts getAccounts() {
36 return accounts;
40 public void addAccounts(com.interrupt.bookkeeping.account.IAccounts accounts) {
41 this.setAccounts(accounts);
43 public void setAccounts(com.interrupt.bookkeeping.account.IAccounts accounts) {
45 this.accounts = accounts;
46 this.accounts.setParent(this);
48 this.removeAllAccounts();
49 super.addAccounts(accounts);
53 // Journals
54 public com.interrupt.bookkeeping.journal.IJournals findJournalsById(String value) {
55 return this.getJournals();
57 public com.interrupt.bookkeeping.journal.IJournals getJournals() {
58 List allJournals = this.allJournals();
59 if(allJournals.size() > 0) {
60 return (com.interrupt.bookkeeping.journal.IJournals)allJournals.get(0);
62 return null;
66 public void addJournals(com.interrupt.bookkeeping.journal.IJournals journals) {
67 this.setJournals(journals);
69 public void setJournals(com.interrupt.bookkeeping.journal.IJournals journals) {
71 this.journals = journals;
72 this.journals.setParent(this);
74 this.removeAllJournals();
75 super.addJournals(journals);
79 // Transactions
80 public com.interrupt.bookkeeping.journal.ITransactions findTransactionsById(String value) {
81 return transactions;
83 public com.interrupt.bookkeeping.journal.ITransactions getTransactions() {
84 return transactions;
88 public void setTransactions(
89 com.interrupt.bookkeeping.journal.ITransactions transactions) {
90 this.transactions = transactions;
91 this.transactions.setParent(this);