A simple range.

< 1.2.5

@see net.ossindex.version.parser.VersionBaseListener#exitSimple_range(net.ossindex.version.parser.VersionParser.Simple_rangeContext)
773825
@Override
  public void exitSimple_range(VersionParser.Simple_rangeContext ctx)
  {
    String operator = ctx.getChild(0).getText();
    Object o = stack.pop();
    if (o instanceof SemanticVersion) {
      //range = new SemanticVersionRange((SemanticVersion)o);
      switch (operator) {
        case "~>":
          // Special case for "pessimistic" range, see
          // https://www.devalot.com/articles/2012/04/gem-versions.html
          SemanticVersion sv = (SemanticVersion) o;
          VersionRange from = new VersionRange(">=", sv);
          VersionRange to = new VersionRange("<", sv.getNextParentVersion());
          range = new AndRange(from, to);
          break;
        default:
          range = new VersionRange(operator, (SemanticVersion) o);
          break;
      }
      stack.push(range);
    }
    else {
      throw new InvalidRangeRuntimeException("Expected a semantic version, got a " + o.getClass().getSimpleName());
    }
  }
471531
public static RubyRange<Double> range(double start, double end) {
    String startStr = String.valueOf(start);
    String endStr = String.valueOf(end);
    int startPrecision = startStr.length() - startStr.lastIndexOf('.') - 1;
    int endPrecision = endStr.length() - endStr.lastIndexOf('.') - 1;
    return new RubyRange<>(
        new DoubleSuccessor(Math.max(startPrecision, endPrecision)), start, end,
        Interval.CLOSED);
  }
433524
@Deprecated
  public void remove(final int rangeStart, final int rangeEnd) {
    if (rangeStart >= 0) {
      remove((long) rangeStart, (long) rangeEnd);
    }
    // rangeStart being -ve and rangeEnd being positive is not expected)
    // so assume both -ve
    remove(rangeStart & 0xFFFFFFFFL, rangeEnd & 0xFFFFFFFFL);
  }
104448
public static Long calculateRangeLength(FileRequestContext context, Range range) {
    if(range.start == -1) range.start = 0;
    if(range.end == -1) range.end = context.file.length() - 1;
    range.length = range.end - range.start + 1;
    return range.length;
  }
646020
public ValidatorBuilderBigInteger<PARENT> range(BigInteger min, BigInteger max) {

    return range(new Range<>(min, max));
  }
188314
private final void doWriteCompletedRanges(List completedRanges)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "doWriteCompletedRanges",
        new Object[] { completedRanges });

    int length = completedRanges.size();
    for (int i=0; i<length; i++)
    {
      completedRanges.set(i, stream.writeCompletedRange((TickRange) completedRanges.get(i)));
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "doWriteCompletedRanges");
  }
1320185
private static <T extends Comparable<T>> void ensureValidRange(T min, T max) {
    if (min == null) {
      throw new InvalidOperationException("Null value for minimum.");
    }
    if (max == null) {
      throw new InvalidOperationException("Null value for maximum.");
    }
    if (min.compareTo(max) >= 0) {
      throw new InvalidOperationException("Invalid range: " + min + " >= " + max);
    }
  }
1235096
private static <T extends Comparable<T>> Optional<Range<T>> smallestContainerForRange(
      Collection<Range<T>> ranges, Range<T> target) {
    Range<T> best = Range.all();
    for (final Range<T> r : ranges) {
      if (r.equals(target)) {
        continue;
      }
      // prefer a smaller range, always;
      if (r.encloses(target) && best.encloses(r)) {
        best = r;
      }
    }
    if (best.equals(Range.<T>all())) {
      return Optional.absent();
    }
    return Optional.of(best);
  }
171567
@Override
  public void exitWhere(GDLParser.WhereContext ctx) {
    addPredicates(Collections.singletonList(currentPredicates.pop()));
  }
158511
public static IntStream numberRangeClosed(int startInclusive,
            int endInclusive, int interval) {
        return numberRange(startInclusive, endInclusive, interval,
                n -> n <= endInclusive);
    }
787102
int lastZeroInRange(int from, int to) {
		if (from < 0) throw new IllegalArgumentException();
		if (to < from) throw new IllegalArgumentException();
		from += start;
		to += start;
		if (to > finish) throw new IllegalArgumentException();
		return lastZeroInRangeAdj(from, to) - start;
	}
928489
public Query range(String start, String end) {
    return range(wrapKey(start), wrapKey(end));
  }
118993
def range_end(self):
        '''
        '''
        count = self.count
        range_end = self.range_start + self.limit - 1
        if count < range_end:
            range_end = count
        return range_end
264048
@Deprecated
    public DataFindRequest range(Integer begin, Integer end) {
        this.begin = begin;
        if (end != null) {
            //'maxResults' should be 1 greater than a 'to' value.
            maxResults = end - (begin == null ? 0 : begin) + 1;
        }

        return this;
    }
1132768
protected /*@pure@*/ int rangeSingle(/*@non_null@*/String singleSelection) {

        String single = singleSelection.trim();
        if (single.toLowerCase().equals("first")) {
            return 0;
        }
        if (single.toLowerCase().equals("last") || single.toLowerCase().equals("-1")) {
            return -1;
        }
        int index = Integer.parseInt(single);
        if (index >= 1) { //Non for negatives
            index--;
        }
        return index;
    }
44272
public ValidatorBuilderShort<PARENT> range(short min, short max) {

    return range(new Range<>(Short.valueOf(min), Short.valueOf(max)));
  }
734405
public IVersionRange getRange(Collection<String> versions) throws InvalidRangeException {
    if (versions == null) {
      return null;
    }
    return getRange(versions.toArray(new String[versions.size()]));
  }