01: /*
02: *
03: * JMoney - A Personal Finance Manager
04: * Copyright (c) 2004 Nigel Westbury <westbury@users.sourceforge.net>
05: *
06: *
07: * This program is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU General Public License as published by
09: * the Free Software Foundation; either version 2 of the License, or
10: * (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20: *
21: */
22:
23: package net.sf.jmoney.reconciliation;
24:
25: import net.sf.jmoney.model2.CurrencyAccount;
26:
27: /**
28: * Interface containing methods that execute queries against the datastore.
29: * <P>
30: * Plug-ins that implement a datastore may optionally implement this interface.
31: * Consumers obtain this interface through the getAdapter method in the session
32: * object.
33: * <P>
34: * See document on 'datastore utilities' for a description
35: * of the overall design.
36: * <P>
37: * @author Nigel Westbury
38: */
39: public interface IReconciliationQueries {
40:
41: /**
42: * Gets the set of all bank statements in this account.
43: * The datastore model does not maintain a list of bank statements,
44: * so the datastore implementation must scan the entries to
45: * find all statements on which an entry occurs. This method
46: * also returns the final balances on each statement.
47: * <P>
48: * The statements are sorted into order.
49: *
50: * @param account
51: * @return
52: */
53: BankStatementAndBalance[] getStatements(CurrencyAccount account);
54:
55: /**
56: * A class containing a statement and balance. An array
57: * of this class is returned by the getStatements method.
58: */
59: public class BankStatementAndBalance {
60: public BankStatement bankStatement;
61: public long balance;
62:
63: public BankStatementAndBalance(BankStatement bankStatement,
64: long balance) {
65: this.bankStatement = bankStatement;
66: this.balance = balance;
67: }
68: }
69: }
|