BrightSide Workbench Full Report + Source Code
AccountReportPeriod.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.report;
19 
24 public class AccountReportPeriod {
25 
26  private AccountReportItem item;
27  private int year, month;
28  private double value;
29 
30  public AccountReportPeriod(int year, int month) {
31  this.year = year;
32  this.month = month;
33  }
34 
35  public int getMonth() {
36  return month;
37  }
38 
39  public void setMonth(int month) {
40  this.month = month;
41  }
42 
44  return item;
45  }
46 
47  public void setItem(AccountReportItem item) {
48  this.item = item;
49  }
50 
51  public double getValue() {
52  return value;
53  }
54 
55  public void setValue(double value) {
56  this.value = value;
57  }
58 
59  public int getYear() {
60  return year;
61  }
62 
63  public void setYear(int year) {
64  this.year = year;
65  }
66 
67  @Override
68  public boolean equals(Object obj) {
69  if (obj == null) {
70  return false;
71  }
72  if (getClass() != obj.getClass()) {
73  return false;
74  }
75  final AccountReportPeriod other = (AccountReportPeriod) obj;
76  if (this.year != other.year) {
77  return false;
78  }
79  if (this.month != other.month) {
80  return false;
81  }
82  return true;
83  }
84 
85  @Override
86  public int hashCode() {
87  int hash = 7;
88  hash = 17 * hash + this.year;
89  hash = 17 * hash + this.month;
90  return hash;
91  }
92 
93 }