BrightSide Workbench Full Report + Source Code
GanttResourceItem.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2012 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 
19 package org.turro.zkoss.svg;
20 
21 import org.turro.util.CompareUtil;
22 
27 public class GanttResourceItem implements Comparable<GanttResourceItem> {
28 
29  private GanttResourceData set;
30 
31  private int type;
32  private String name, uniqueId;
33  private double expected, variable;
34  private int position = -1;
35 
36  public GanttResourceItem(int type, String uniqueId, String name) {
37  this.type = type;
38  this.uniqueId = uniqueId;
39  this.name = name;
40  }
41 
42  public double getExpected() {
43  return expected;
44  }
45 
46  public void setExpected(double expected) {
47  this.expected = expected;
48  }
49 
50  public double getVariable() {
51  return variable;
52  }
53 
54  public void setVariable(double variable) {
55  this.variable = variable;
56  }
57 
58  public String getName() {
59  return name;
60  }
61 
62  public String getUniqueId() {
63  return uniqueId;
64  }
65 
66  public int getType() {
67  return type;
68  }
69 
70  public int getPosition() {
71  return position;
72  }
73 
74  public void setPosition(int position) {
75  this.position = position;
76  }
77 
79  return set;
80  }
81 
82  public void setSet(GanttResourceData set) {
83  this.set = set;
84  }
85 
86  @Override
87  public int compareTo(GanttResourceItem o) {
88  int result = CompareUtil.compare(type, o.type);
89  if(result == 0) {
90  result = CompareUtil.compare(name, o.name);
91  }
92  if(result == 0) {
93  result = CompareUtil.compare(uniqueId, o.uniqueId);
94  }
95  return result;
96  }
97 
98 }
GanttResourceItem(int type, String uniqueId, String name)
void setSet(GanttResourceData set)