BrightSide Workbench Full Report + Source Code
org.turro.financials.report.PeriodSet Class Reference
Inheritance diagram for org.turro.financials.report.PeriodSet:
Collaboration diagram for org.turro.financials.report.PeriodSet:

Public Member Functions

 PeriodSet ()
 
AccountReportPeriod getPeriod (AccountReportPeriod period)
 
void fillGapsTillNow (AccountReportItem item)
 
PeriodSet getCurrentPeriod (int count)
 
void incrementPeriod (int amount)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 28 of file PeriodSet.java.

Constructor & Destructor Documentation

◆ PeriodSet()

org.turro.financials.report.PeriodSet.PeriodSet ( )

Definition at line 32 of file PeriodSet.java.

32  {
33  super(new PeriodComparator());
34  }
Here is the caller graph for this function:

Member Function Documentation

◆ fillGapsTillNow()

void org.turro.financials.report.PeriodSet.fillGapsTillNow ( AccountReportItem  item)

Definition at line 45 of file PeriodSet.java.

45  {
46  AccountReportPeriod arp = first();
47  if(arp != null) {
48  CheckDate cd = new CheckDate(arp.getYear(), arp.getMonth(), 1, 0, 0, 0);
49  Date now = new Date();
50  while(cd.compareMonthYear(now) == -1) {
51  AccountReportPeriod a = new AccountReportPeriod(cd.getYear(), cd.getMonth());
52  a.setValue(0);
53  a.setItem(item);
54  add(a);
55  cd.addMonths(1);
56  }
57  }
58  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCurrentPeriod()

PeriodSet org.turro.financials.report.PeriodSet.getCurrentPeriod ( int  count)

Definition at line 60 of file PeriodSet.java.

60  {
61  if(year == 0 || month == 0) {
62  CheckDate cd = new CheckDate();
63  cd.addMonths(-(count/2));
64  year = cd.getYear();
65  month = cd.getMonth();
66  }
67  PeriodSet ps = new PeriodSet();
68  int c = 0;
69  for(AccountReportPeriod arp : tailSet(new AccountReportPeriod(year, month))) {
70  ps.add(arp);
71  if(c++ > count - 1) break;
72  }
73  return ps;
74  }
Here is the call graph for this function:

◆ getPeriod()

AccountReportPeriod org.turro.financials.report.PeriodSet.getPeriod ( AccountReportPeriod  period)

Definition at line 36 of file PeriodSet.java.

36  {
37  for(AccountReportPeriod p : this) {
38  if(p.equals(period)) {
39  return p;
40  }
41  }
42  return null;
43  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ incrementPeriod()

void org.turro.financials.report.PeriodSet.incrementPeriod ( int  amount)

Definition at line 76 of file PeriodSet.java.

76  {
77  CheckDate cd = new CheckDate(year, month, 1, 0, 0, 0);
78  cd.addMonths(amount);
79  year = cd.getYear();
80  month = cd.getMonth();
81  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: