@@ -0,0 +1,1654 @@
+package com.facebook.presto;%0A%0Aimport com.google.common.base.Function;%0Aimport com.google.common.collect.DiscreteDomains;%0Aimport com.google.common.collect.Range;%0A%0Aimport javax.annotation.Nullable;%0A%0Apublic class RangePositionBlock%0A        implements PositionBlock%0A%7B%0A    private final Range%3CLong%3E range;%0A%0A    public RangePositionBlock(Range%3CLong%3E range)%0A    %7B%0A        this.range = range;%0A    %7D%0A%0A    @Override%0A    public boolean isEmpty()%0A    %7B%0A        return range.isEmpty();%0A    %7D%0A%0A    @Override%0A    public int getCount()%0A    %7B%0A        return (int) (range.upperEndpoint() - range.lowerEndpoint() + 1);%0A    %7D%0A%0A    @Override%0A    public boolean isSorted()%0A    %7B%0A        return false;%0A    %7D%0A%0A    @Override%0A    public boolean isSingleValue()%0A    %7B%0A        return getCount() == 1;%0A    %7D%0A%0A    @Override%0A    public boolean isPositionsContiguous()%0A    %7B%0A        return true;%0A    %7D%0A%0A    @Override%0A    public Iterable%3CLong%3E getPositions()%0A    %7B%0A        return range.asSet(DiscreteDomains.longs());%0A    %7D%0A%0A    @Override%0A    public Range%3CLong%3E getRange()%0A    %7B%0A        return range;%0A    %7D%0A%0A    @Override%0A    public boolean apply(@Nullable Long input)%0A    %7B%0A        return range.apply(input);%0A    %7D%0A%0A    @Override%0A    public String toString()%0A    %7B%0A        return String.format(%22%5B%25s..%25s%5D%22, range.lowerEndpoint(), range.upperEndpoint());%0A    %7D%0A%0A    public static Function%3CRangePositionBlock, Range%3CLong%3E%3E rangeGetter()%0A    %7B%0A        return new Function%3CRangePositionBlock, Range%3CLong%3E%3E()%0A        %7B%0A            @Override%0A            public Range%3CLong%3E apply(RangePositionBlock input)%0A            %7B%0A                return input.getRange();%0A            %7D%0A        %7D;%0A    %7D%0A%0A%7D%0A

implement RangePositionBlock