-
Notifications
You must be signed in to change notification settings - Fork 5
/
TimeSeriesEntry.java
45 lines (38 loc) · 1.08 KB
/
TimeSeriesEntry.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* © 2021. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/
package edu.ie3.datamodel.models.timeseries;
import edu.ie3.datamodel.models.Entity;
import edu.ie3.datamodel.models.value.Value;
import java.util.Objects;
/**
* This is an abstract class describing a unique entry to a time series
*
* @param <V> Type of the contained value
*/
public abstract class TimeSeriesEntry<V extends Value> implements Entity {
protected final V value;
protected TimeSeriesEntry(V value) {
this.value = value;
}
public V getValue() {
return value;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TimeSeriesEntry<?> entry = (TimeSeriesEntry<?>) o;
return value.equals(entry.value);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), value);
}
@Override
public String toString() {
return "TimeSeriesEntry{" + "value=" + value + '}';
}
}