Converts an Accumulo Range to a Fluo Span

@param range Range
@return Span
326773
public static Span toSpan(Range range) {
    return new Span(toRowColumn(range.getStartKey()), range.isStartKeyInclusive(),
        toRowColumn(range.getEndKey()), range.isEndKeyInclusive());
  }
118197
public LBuffer slice(long from, long to) {
        if(from > to)
            throw new IllegalArgumentException(String.format("invalid range %,d to %,d", from, to));

        long size = to - from;
        LBuffer b = new LBuffer(size);
        copyTo(from, b, 0, size);
        return b;
    }
489975
public static boolean[] updateRanges(boolean[] range, GrammarRules grammar) {
    boolean[] res = Arrays.copyOf(range, range.length);
    for (GrammarRuleRecord r : grammar) {
      if (0 == r.getRuleNumber()) {
        continue;
      }
      res = updateRanges(res, r.getRuleIntervals());
    }
    return res;
  }
415310
public function getRange(Range $range)
    {
        $content = $this->getContent();
        $start = $range->start->toOffset($content);
        $length = $range->end->toOffset($content) - $start;
        return substr($content, $start, $length);
    }
226911
@SuppressWarnings("unchecked")
    public static List<Double> getAt(double[] array, Range range) {
        return primitiveArrayGet(array, range);
    }
413014
public static Range toRange(Span span) {
    return new Range(toKey(span.getStart()), span.isStartInclusive(), toKey(span.getEnd()),
        span.isEndInclusive());
  }
326303
@Override
    public ValueRange range(ChronoField field) {
        switch (field) {
            case ALIGNED_WEEK_OF_MONTH:
                return ALIGNED_WEEK_OF_MONTH_RANGE;
            case ALIGNED_WEEK_OF_YEAR:
                return ALIGNED_WEEK_OF_YEAR_RANGE;
            case DAY_OF_MONTH:
                return DAY_OF_MONTH_RANGE;
            case DAY_OF_YEAR:
                return DAY_OF_YEAR_RANGE;
            case MONTH_OF_YEAR:
                return MONTH_OF_YEAR_RANGE;
            default:
                return field.range();
        }
    }
775597
protected static List primitiveArrayGet(Object self, Range range) {
        List answer = new ArrayList();
        for (Object next : range) {
            int idx = DefaultTypeTransformation.intUnbox(next);
            answer.add(primitiveArrayGet(self, idx));
        }
        return answer;
    }
1018948
public function asDatespan(DatespanRange $range = null)
    {
        $this->checkDefaultType(function() { return $this->default instanceof Datespan;}, Datespan::class);
        return $this->default;
    }
362001
public static Range absRange(Range range) {
        if (range.getMinimum().doubleValue() >= 0 && range.getMaximum().doubleValue() >= 0) {
            return range;
        } else if (range.getMinimum().doubleValue() < 0 && range.getMaximum().doubleValue() < 0) {
            return range(- range.getMaximum().doubleValue(), - range.getMinimum().doubleValue());
        } else {
            return range(0, Math.max(range.getMinimum().doubleValue(), range.getMaximum().doubleValue()));
        }
    }
1324194
public static function fromString($range)
    {
        $result = null;
        if (is_string($range) && strpos($range, '*') !== false) {
            $matches = null;
            if ($range === '*.*.*.*') {
                $result = new static(IPv4::fromString('0.0.0.0'), IPv4::fromString('255.255.255.255'), 4);
            } elseif (strpos($range, '.') !== false && preg_match('/^[^*]+((?:\.\*)+)$/', $range, $matches)) {
                $asterisksCount = strlen($matches[1]) >> 1;
                if ($asterisksCount > 0) {
                    $missingDots = 3 - substr_count($range, '.');
                    if ($missingDots > 0) {
                        $range .= str_repeat('.*', $missingDots);
                        $asterisksCount += $missingDots;
                    }
                }
                $fromAddress = IPv4::fromString(str_replace('*', '0', $range));
                if ($fromAddress !== null) {
                    $fixedBytes = array_slice($fromAddress->getBytes(), 0, -$asterisksCount);
                    $otherBytes = array_fill(0, $asterisksCount, 255);
                    $toAddress = IPv4::fromBytes(array_merge($fixedBytes, $otherBytes));
                    $result = new static($fromAddress, $toAddress, $asterisksCount);
                }
            } elseif ($range === '*:*:*:*:*:*:*:*') {
                $result = new static(IPv6::fromString('::'), IPv6::fromString('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'), 8);
            } elseif (strpos($range, ':') !== false && preg_match('/^[^*]+((?::\*)+)$/', $range, $matches)) {
                $asterisksCount = strlen($matches[1]) >> 1;
                $fromAddress = IPv6::fromString(str_replace('*', '0', $range));
                if ($fromAddress !== null) {
                    $fixedWords = array_slice($fromAddress->getWords(), 0, -$asterisksCount);
                    $otherWords = array_fill(0, $asterisksCount, 0xffff);
                    $toAddress = IPv6::fromWords(array_merge($fixedWords, $otherWords));
                    $result = new static($fromAddress, $toAddress, $asterisksCount);
                }
            }
        }

        return $result;
    }
723221
public boolean IsOverlapping(FloatRange range) {
        return ((isInside(range.min)) || (isInside(range.max)) ||
                (range.isInside(min)) || (range.isInside(max)));
    }
544049
public static Range valueOf(final String value) {
        final Optional<Integer[]> vals = parse(value);
        if (vals.isPresent()) {
            return new Range(vals.get()[0], vals.get()[1]);
        }
        return null;
    }
1281783
public Range[] union(Range that){
        if(this.min>that.min)
            return that.union(this);

        // this -------------
        // that    --------------
        // that    -------
        if(contains(that.min))
            return new Range[]{ new Range(this.min, Math.max(this.max, that.max)) };

        // this -----------
        // that                --------------
        return new Range[]{ this, that };
    }
718539
public Mutations<S> removeMutationsInRange(Range range) {
        return removeMutationsInRange(range.getFrom(), range.getTo());
    }
116034
@Override
  public Collection<Range<T>> rangesOverlapping(final Range<T> queryRange) {
    final ImmutableSet.Builder<Range<T>> ret = ImmutableSet.builder();
    for (final Range<T> range : ranges) {
      if (range.isConnected(queryRange) && !range.intersection(queryRange).isEmpty()) {
        ret.add(range);
      }
    }
    return ret.build();
  }
83523
public static <T> List<T> getAt(T[] array, Range range) {
        List<T> list = Arrays.asList(array);
        return getAt(list, range);
    }