@@ -0,0 +1,1729 @@
+package io.github.mstuefer;%0A%0Aimport java.util.*;%0Aimport java.util.stream.Stream;%0A%0Apublic class MidpointQueryOptimiserStrategy implements QueryOptimiserStrategy %7B%0A%0A    private static final int LOWERBOUND = 0;%0A    private static final int UPPERBOUND = 1;%0A%0A    private TableHistogram tableHistogram;%0A    private DataReader dataReader;%0A%0A    private Plan midpointPlan;%0A%0A    MidpointQueryOptimiserStrategy(TableHistogram tableHistogram, DataReader dataReader) %7B%0A        this.tableHistogram = tableHistogram;%0A        this.dataReader = dataReader;%0A        midpointPlan = new Plan();%0A    %7D%0A%0A    @Override%0A    public Plan optimise(Query query) %7B%0A        List%3CSelectionOperator%3E selectionOperators = query.getSelectionOperators();%0A%0A        Double%5B%5D midpoints = new Double%5BselectionOperators.size()%5D;%0A        HashMap%3CSelectionOperator, Double%3E midpoints2 = new HashMap%3C%3E();%0A%0A        for (int i = 0; i %3C selectionOperators.size(); i++) %7B%0A            double%5B%5D intervalSelectivity = new IntervalSelectivityCalculator(tableHistogram, dataReader)%0A                    .getIntervalSelectivity(selectionOperators.get(i));%0A%0A            midpoints%5Bi%5D = ((intervalSelectivity%5BUPPERBOUND%5D - intervalSelectivity%5BLOWERBOUND%5D)/2) + intervalSelectivity%5BLOWERBOUND%5D;%0A            midpoints2.put(selectionOperators.get(i), midpoints%5Bi%5D);%0A        %7D%0A%0A%0A        Stream%3CMap.Entry%3CSelectionOperator, Double%3E%3E ascMidPoints =%0A                midpoints2.entrySet().stream().sorted(Map.Entry.comparingByValue());%0A%0A        ascMidPoints.forEach(this::fillMidpointPlan);%0A%0A        return midpointPlan;%0A    %7D%0A%0A    private void fillMidpointPlan(Map.Entry%3CSelectionOperator, Double%3E entry) %7B%0A        midpointPlan.addSelectionOperator(entry.getKey(), entry.getValue());%0A    %7D%0A%0A%7D%0A

Add MidpointQueryOptimiserStrategy