#3 -- fix comparator

This commit is contained in:
Anton Romanov 2022-04-19 22:19:49 +04:00
parent 3e26083765
commit c309c71b84
2 changed files with 12 additions and 2 deletions

View File

@ -2,7 +2,7 @@ package ru.ulstu.db.model;
import ru.ulstu.datamodel.ts.TimeSeries;
public class TimeSeriesMeta {
public class TimeSeriesMeta implements Comparable<TimeSeriesMeta> {
private String key;
private int size;
private boolean hasDateTime;
@ -31,4 +31,9 @@ public class TimeSeriesMeta {
public boolean isHasDateTime() {
return hasDateTime;
}
@Override
public int compareTo(TimeSeriesMeta o) {
return o != null ? key.compareTo(o.getKey()) : 0;
}
}

View File

@ -2,7 +2,7 @@ package ru.ulstu.db.model;
import java.io.File;
public class TimeSeriesSet {
public class TimeSeriesSet implements Comparable<TimeSeriesSet> {
private final String key;
public TimeSeriesSet(File dir) {
@ -16,4 +16,9 @@ public class TimeSeriesSet {
public String getKey() {
return key;
}
@Override
public int compareTo(TimeSeriesSet o) {
return o != null ? key.compareTo(o.getKey()) : 0;
}
}