BoxAggregator is no longer an indexed aggregator

This commit is contained in:
2022-11-20 16:56:58 +01:00
parent 04c09f6ba4
commit 0d1b9b59ee
2 changed files with 2 additions and 45 deletions

View File

@@ -6,11 +6,7 @@ import java.util.UUID;
import org.lucares.collections.LongObjHashMap; import org.lucares.collections.LongObjHashMap;
import org.lucares.recommind.logs.GnuplotAxis; import org.lucares.recommind.logs.GnuplotAxis;
public class BoxAggregator implements CustomAggregator, IndexedAggregator { public class BoxAggregator implements CustomAggregator {
private Long index = null;
private Long numberOfDataSeries;
private final String dataName = "$data" + UUID.randomUUID().toString().replace("-", ""); private final String dataName = "$data" + UUID.randomUUID().toString().replace("-", "");
private final Interval interval; private final Interval interval;
@@ -43,28 +39,6 @@ public class BoxAggregator implements CustomAggregator, IndexedAggregator {
return Aggregate.BOX; return Aggregate.BOX;
} }
@Override
public void setIndex(final long index, final long numberOfDataSeries) {
this.index = index;
this.numberOfDataSeries = numberOfDataSeries;
}
@Override
public long getIndex() throws IllegalStateException {
if (this.index == null) {
throw new IllegalStateException("index was not set");
}
return this.index;
}
@Override
public long getNumberOfDataSeries() throws IllegalStateException {
if (this.numberOfDataSeries == null) {
throw new IllegalStateException("index was not set");
}
return this.numberOfDataSeries;
}
public Object getDataName() { public Object getDataName() {
return dataName; return dataName;
} }

View File

@@ -83,24 +83,7 @@ public class BoxChartHandler extends AggregateHandler {
} }
private double width(final IntervalTimeUnit intervalTimeUnit) { private double width(final IntervalTimeUnit intervalTimeUnit) {
switch (intervalTimeUnit) { return intervalTimeUnit.toMillis() / 1000;
case SECOND:
return 1;
case MINUTE:
return 60;
case HOUR:
return 3600;
case DAY:
return 86400;
case WEEK:
return 24 * 3600;
case MONTH:
return 30 * 24 * 3600;
case YEAR:
return 365 * 24 * 3600;
default:
throw new IllegalArgumentException("Unexpected value: " + this);
}
} }
@Override @Override