01: package com.technoetic.xplanner.charts;
02:
03: import java.io.Serializable;
04: import java.util.Date;
05:
06: public class DataSample implements Serializable {
07: private Date sampleTime;
08: private int referenceId;
09: private String aspect;
10: private double value;
11:
12: // For Hibernate
13: DataSample() {
14: }
15:
16: public DataSample(Date sampleTime, int referenceId, String aspect,
17: double value) {
18: this .sampleTime = sampleTime;
19: this .referenceId = referenceId;
20: this .aspect = aspect;
21: this .value = value;
22: }
23:
24: public Date getSampleTime() {
25: return sampleTime;
26: }
27:
28: public void setSampleTime(Date sampleTime) {
29: this .sampleTime = sampleTime;
30: }
31:
32: public int getReferenceId() {
33: return referenceId;
34: }
35:
36: public void setReferenceId(int referenceId) {
37: this .referenceId = referenceId;
38: }
39:
40: public String getAspect() {
41: return aspect;
42: }
43:
44: public void setAspect(String aspect) {
45: this .aspect = aspect;
46: }
47:
48: public double getValue() {
49: return value;
50: }
51:
52: public void setValue(double value) {
53: this .value = value;
54: }
55:
56: public String toString() {
57: return aspect + " of oid " + referenceId + " on " + sampleTime
58: + " was " + value;
59: }
60:
61: public boolean equals(Object o) {
62: if (this == o)
63: return true;
64: if (!(o instanceof DataSample))
65: return false;
66:
67: final DataSample dataSample = (DataSample) o;
68:
69: if (referenceId != dataSample.referenceId)
70: return false;
71: if (value != dataSample.value)
72: return false;
73: if (aspect != null ? !aspect.equals(dataSample.aspect)
74: : dataSample.aspect != null)
75: return false;
76: if (sampleTime != null ? !sampleTime
77: .equals(dataSample.sampleTime)
78: : dataSample.sampleTime != null)
79: return false;
80:
81: return true;
82: }
83:
84: public int hashCode() {
85: int result;
86: long temp;
87: result = (sampleTime != null ? sampleTime.hashCode() : 0);
88: result = 29 * result + referenceId;
89: result = 29 * result + (aspect != null ? aspect.hashCode() : 0);
90: temp = Double.doubleToLongBits(value);
91: result = 29 * result + (int) (temp ^ (temp >>> 32));
92: return result;
93: }
94: }
|