BrightSide Workbench Full Report + Source Code
GenericStatementSet.java
Go to the documentation of this file.
1
/*
2
* TurrĂ³ i Cutiller Foundation. License notice.
3
* Copyright (C) 2011 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU Affero General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Affero General Public License for more details.
14
*
15
* You should have received a copy of the GNU Affero General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
package
org.turro.financials.register;
19
20
import
java.util.Iterator;
21
import
java.util.List;
22
import
java.util.TreeSet;
23
import
org.turro.financials.account.logic.StatementEntry;
24
import
org.turro.financials.db.FinancialsPU;
25
import
org.turro.financials.entity.RegisterEntry;
26
import
org.turro.jpa.Dao;
27
32
public
abstract
class
GenericStatementSet
extends
TreeSet<StatementEntry> {
33
34
public
GenericStatementSet
() {
35
}
36
37
public
void
loadData
() {
38
clear();
39
Dao
dao =
new
FinancialsPU
();
40
addEntries(dao);
41
checkBalance();
42
}
43
44
public
abstract
List<RegisterEntry>
getEntries
(
Dao
dao);
45
46
private
void
checkBalance() {
47
Iterator<StatementEntry> it = iterator();
48
double
balance = 0;
49
while
(it.hasNext()) {
50
StatementEntry
se = it.next();
51
se.
setInheritedBalance
(balance);
52
balance = se.
getBalance
();
53
}
54
}
55
56
private
void
addEntries(Dao dao) {
57
for
(RegisterEntry re :
getEntries
(dao)) {
58
add(
new
StatementEntry(re));
59
}
60
}
61
62
}
org.turro.financials.account.logic.StatementEntry
Definition:
StatementEntry.java:34
org.turro.financials.account.logic.StatementEntry.setInheritedBalance
void setInheritedBalance(double inheritedBalance)
Definition:
StatementEntry.java:137
org.turro.financials.account.logic.StatementEntry.getBalance
double getBalance()
Definition:
StatementEntry.java:50
org.turro.financials.db.FinancialsPU
Definition:
FinancialsPU.java:32
org.turro.financials.register.GenericStatementSet
Definition:
GenericStatementSet.java:32
org.turro.financials.register.GenericStatementSet.GenericStatementSet
GenericStatementSet()
Definition:
GenericStatementSet.java:34
org.turro.financials.register.GenericStatementSet.loadData
void loadData()
Definition:
GenericStatementSet.java:37
org.turro.financials.register.GenericStatementSet.getEntries
abstract List< RegisterEntry > getEntries(Dao dao)
org.turro.jpa.Dao
Definition:
Dao.java:52
TurroProjects
Public
BrightSide
bsfinancials-www
src
main
java
org
turro
financials
register
GenericStatementSet.java
Generated on Tue Mar 12 2024 07:01:19 for BrightSide by
1.9.1