public boolean isAll() { return low.isLowerUnbounded() && high.isUpperUnbounded(); }
public String toString(ConnectorSession session) { StringBuilder buffer = new StringBuilder("{"); buffer.append("type=").append(type); buffer.append(", value="); if (isLowerUnbounded()) { buffer.append("<min>"); } else if (isUpperUnbounded()) { buffer.append("<max>"); } else { buffer.append(getPrintableValue(session)); } buffer.append(", bound=").append(bound); buffer.append("}"); return buffer.toString(); } }
/** * Adjacency is defined by two Markers being infinitesimally close to each other. * This means they must share the same value and have adjacent Bounds. */ public boolean isAdjacent(Marker other) { checkTypeCompatibility(other); if (isUpperUnbounded() || isLowerUnbounded() || other.isUpperUnbounded() || other.isLowerUnbounded()) { return false; } if (type.compareTo(valueBlock.get(), 0, other.valueBlock.get(), 0) != 0) { return false; } return (bound == Bound.EXACTLY && other.bound != Bound.EXACTLY) || (bound != Bound.EXACTLY && other.bound == Bound.EXACTLY); }
public String toString(ConnectorSession session) { StringBuilder buffer = new StringBuilder(); if (isSingleValue()) { buffer.append('[').append(low.getPrintableValue(session)).append(']'); } else { buffer.append((low.getBound() == Marker.Bound.EXACTLY) ? '[' : '('); buffer.append(low.isLowerUnbounded() ? "<min>" : low.getPrintableValue(session)); buffer.append(", "); buffer.append(high.isUpperUnbounded() ? "<max>" : high.getPrintableValue(session)); buffer.append((high.getBound() == Marker.Bound.EXACTLY) ? ']' : ')'); } return buffer.toString(); } }
return o.isUpperUnbounded() ? 0 : 1; if (isLowerUnbounded()) { return o.isLowerUnbounded() ? 0 : -1; if (o.isLowerUnbounded()) { return 1;
builder.append((range.getLow().getBound() == Marker.Bound.EXACTLY) ? '[' : '('); if (range.getLow().isLowerUnbounded()) { builder.append("<min>");
@Test public void testUnbounded() { assertTrue(Marker.lowerUnbounded(BIGINT).isLowerUnbounded()); assertFalse(Marker.lowerUnbounded(BIGINT).isUpperUnbounded()); assertTrue(Marker.upperUnbounded(BIGINT).isUpperUnbounded()); assertFalse(Marker.upperUnbounded(BIGINT).isLowerUnbounded()); assertFalse(Marker.below(BIGINT, 1L).isLowerUnbounded()); assertFalse(Marker.below(BIGINT, 1L).isUpperUnbounded()); assertFalse(Marker.exactly(BIGINT, 1L).isLowerUnbounded()); assertFalse(Marker.exactly(BIGINT, 1L).isUpperUnbounded()); assertFalse(Marker.above(BIGINT, 1L).isLowerUnbounded()); assertFalse(Marker.above(BIGINT, 1L).isUpperUnbounded()); }
if (!range.getLow().isLowerUnbounded()) { switch (range.getLow().getBound()) { case ABOVE:
private static boolean isBetween(Range range) { return !range.getLow().isLowerUnbounded() && range.getLow().getBound() == Marker.Bound.EXACTLY && !range.getHigh().isUpperUnbounded() && range.getHigh().getBound() == Marker.Bound.EXACTLY; }
if (!range.getLow().isLowerUnbounded()) { switch (range.getLow().getBound()) { case ABOVE:
@Override public SortedRangeSet complement() { Builder builder = new Builder(type); if (lowIndexedRanges.isEmpty()) { return builder.add(Range.all(type)).build(); } Iterator<Range> rangeIterator = lowIndexedRanges.values().iterator(); Range firstRange = rangeIterator.next(); if (!firstRange.getLow().isLowerUnbounded()) { builder.add(new Range(Marker.lowerUnbounded(type), firstRange.getLow().lesserAdjacent())); } Range previousRange = firstRange; while (rangeIterator.hasNext()) { Range currentRange = rangeIterator.next(); Marker lowMarker = previousRange.getHigh().greaterAdjacent(); Marker highMarker = currentRange.getLow().lesserAdjacent(); builder.add(new Range(lowMarker, highMarker)); previousRange = currentRange; } Range lastRange = previousRange; if (!lastRange.getHigh().isUpperUnbounded()) { builder.add(new Range(lastRange.getHigh().greaterAdjacent(), Marker.upperUnbounded(type))); } return builder.build(); }
if (!range.getLow().isLowerUnbounded()) { switch (range.getLow().getBound()) { case ABOVE:
if (!range.getLow().isLowerUnbounded()) { switch (range.getLow().getBound()) { case ABOVE:
if (!range.getLow().isLowerUnbounded()) { switch (range.getLow().getBound()) { case ABOVE:
if (!range.getLow().isLowerUnbounded()) { switch (range.getLow().getBound()) { case ABOVE:
if (prestoRange.getLow().isLowerUnbounded()) {
Range span = ranges.getSpan(); Marker low = span.getLow(); if (!low.isLowerUnbounded()) { KuduPredicate.ComparisonOp op = (low.getBound() == Marker.Bound.ABOVE) ? KuduPredicate.ComparisonOp.GREATER : KuduPredicate.ComparisonOp.GREATER_EQUAL;
public boolean isAll() { return low.isLowerUnbounded() && high.isUpperUnbounded(); }
public String toString(ConnectorSession session) { StringBuilder buffer = new StringBuilder(); if (isSingleValue()) { buffer.append('[').append(low.getPrintableValue(session)).append(']'); } else { buffer.append((low.getBound() == Marker.Bound.EXACTLY) ? '[' : '('); buffer.append(low.isLowerUnbounded() ? "<min>" : low.getPrintableValue(session)); buffer.append(", "); buffer.append(high.isUpperUnbounded() ? "<max>" : high.getPrintableValue(session)); buffer.append((high.getBound() == Marker.Bound.EXACTLY) ? ']' : ')'); } return buffer.toString(); } }
private static boolean isBetween(Range range) { return !range.getLow().isLowerUnbounded() && range.getLow().getBound() == Marker.Bound.EXACTLY && !range.getHigh().isUpperUnbounded() && range.getHigh().getBound() == Marker.Bound.EXACTLY; }