Creates a new {@link Range} with the specified inclusive end and the current start.
559069
public R endClosed(@Nonnull T end) {
    this.end = Preconditions.checkNotNull(end, "End can't be null");
    this.endBound = BoundType.CLOSED;
    return thisT();
  }
84469
public static <N extends Number & Comparable<? super N>> Rectangle range(final Range<N> range) {
        checkNotNull(range);
        if (range.isEmpty()) {
            throw new IllegalArgumentException("range must not be empty");
        }
        if (!range.hasLowerBound() || !range.hasUpperBound()) {
            throw new IllegalArgumentException("range must have lower and upper bounds");
        }
        Number lowerEndpoint = range.lowerEndpoint();
        BoundType lowerBoundType = range.lowerBoundType();
        Number upperEndpoint = range.upperEndpoint();
        BoundType upperBoundType = range.upperBoundType();

        /*

          Since we are representing genomic coordinate systems, the expectation is
          that endpoints are instance of Integer, Long, or BigInteger; thus for open
          lower and upper bounds we can safely add or substract 1.0 respectively.

          Then by convention a rectangle with y1 0.0 and height of 1.0 is used.

          closed(10, 20) --> (10.0, 0.0, 20.0, 1.0)
          closedOpen(10, 20) --> (10.0, 0.0, 19.0, 1.0)
          openClosed(10, 20) --> (11.0, 0.0, 20.0, 1.0)
          open(10, 20) --> (11.0, 0.0, 19.0, 1.0);

          closed(10, 11) --> (10.0, 0.0, 11.0, 1.0)
          closedOpen(10, 11) --> (10.0, 0.0, 10.0, 1.0)
          openClosed(10, 11) --> (11.0, 0.0, 11.0, 1.0)
          open(10, 11) --> empty, throw exception

          closed(10, 10) --> (10.0, 0.0, 10.0, 1.0)
          closedOpen(10, 10) --> empty, throw exception
          openClosed(10, 10) --> empty, throw exception
          open(10, 10) --> empty, throw exception

        */
        double x1 = lowerBoundType == BoundType.OPEN ? lowerEndpoint.doubleValue() + 1.0d : lowerEndpoint.doubleValue();
        double y1 = 0.0d;
        double x2 = upperBoundType == BoundType.OPEN ? upperEndpoint.doubleValue() - 1.0d : upperEndpoint.doubleValue();
        double y2 = 1.0d;
        return Geometries.rectangle(x1, y1, x2, y2);
    }
215558
public static DateRange range(Date start, Date end, final DateField unit) {
		return new DateRange(start, end, unit);
	}
313909
function (start, end) {
    var offsetStart;
    var offsetEnd;

    loadBufferIfRequired(start, end);

    offsetStart = start - currentRange.start;
    offsetEnd = offsetStart + (end - start);

    return buffer.slice(offsetStart, offsetEnd);
  }
466756
public static <T> KeyRange<T> closedOpen(final T start, final T stop) {
    return new KeyRange<>(KeyRangeType.FORWARD_CLOSED_OPEN, start, stop);
  }
977071
public static INDArrayIndex[] createFromStartAndEnd(INDArray start, INDArray end) {
        if (start.length() != end.length())
            throw new IllegalArgumentException("Start length must be equal to end length");
        else {
            if (start.length() > Integer.MAX_VALUE)
                throw new ND4JIllegalStateException("Can't proceed with INDArray with length > Integer.MAX_VALUE");

            INDArrayIndex[] indexes = new INDArrayIndex[(int) start.length()];
            for (int i = 0; i < indexes.length; i++) {
                indexes[i] = NDArrayIndex.interval(start.getInt(i), end.getInt(i));
            }
            return indexes;
        }
    }
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
421649
public Expression<Double> between(Double startValue, Double endValue) {
		String valueString = "'" + startValue + "' AND '" + endValue + "'";
		return new Expression<Double>(this, Operation.between, valueString);
	}
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;
    }
1162255
public static KeyRange openOpen(Key start, Key end) {
    return new KeyRange(checkNotNull(start), Endpoint.OPEN, checkNotNull(end), Endpoint.OPEN);
  }
451241
function createRange(fromRight) {
  return function(start, end, step) {
    if (step && typeof step != 'number' && _isIterateeCall(start, end, step)) {
      end = step = undefined;
    }
    // Ensure the sign of `-0` is preserved.
    start = toFinite_1(start);
    if (end === undefined) {
      end = start;
      start = 0;
    } else {
      end = toFinite_1(end);
    }
    step = step === undefined ? (start < end ? 1 : -1) : toFinite_1(step);
    return _baseRange(start, end, step, fromRight);
  };
}
463400
final public void addPositionRange(int start, int end) {
    if (tokenPosition == null) {
      tokenPosition = new MtasPosition(start, end);
    } else {
      int[] positions = new int[end - start + 1];
      for (int i = start; i <= end; i++) {
        positions[i - start] = i;
      }
      tokenPosition.add(positions);
    }
  }
748363
public static RubyRange<LocalDateTime> range(LocalDateTime start,
      LocalDateTime end) {
    return new RubyRange<>(LocalDateTimeSuccessor.getInstance(), start, end,
        Interval.CLOSED);
  }
323491
public static <C extends Comparable> C center(final Range<C> range) {
        checkNotNull(range);
        if (!range.hasLowerBound() && !range.hasUpperBound()) {
            throw new IllegalStateException("cannot find the center of a range without bounds");
        }
        if (!range.hasLowerBound()) {
            return range.upperEndpoint();
        }
        if (!range.hasUpperBound()) {
            return range.lowerEndpoint();
        }
        C lowerEndpoint = range.lowerEndpoint();
        C upperEndpoint = range.upperEndpoint();

        if (upperEndpoint instanceof Integer) {
            Integer upper = (Integer) upperEndpoint;
            Integer lower = (Integer) lowerEndpoint;
            return (C) Integer.valueOf((upper.intValue() + lower.intValue()) / 2);
        }
        if (upperEndpoint instanceof Long) {
            Long upper = (Long) upperEndpoint;
            Long lower = (Long) lowerEndpoint;
            return (C) Long.valueOf((upper.longValue() + lower.longValue()) / 2L);
        }
        if (upperEndpoint instanceof BigInteger) {
            BigInteger upper = (BigInteger) upperEndpoint;
            BigInteger lower = (BigInteger) lowerEndpoint;
            BigInteger two = BigInteger.valueOf(2L);
            return (C) upper.subtract(lower).divide(two);
        }

        // todo:  could potentially calculate the center of any range with a discrete domain
        throw new IllegalStateException("cannot find the center of a range whose endpoint type is not Integer, Long, or BigInteger");
    }
462310
TokenRange range(JavaToken begin, JavaToken end) {
        if (storeTokens) {
            return new TokenRange(begin, end);
        }
        return null;
    }
632676
function RangeIterator(start, end, step) {
    this.start = start;
    this.end = (end !== undefined) ? end : Math.pow(2,32);    // or should this be Number.MAX_VALUE
    this.step = (step !== undefined)
        ? step
        : (this.end >= this.start)
            ? 1
            : -1;
    this.reset();
}
58494
private static long end(Range<Long> range) {
        if (range.upperBoundType() == BoundType.OPEN) {
            return DiscreteDomain.longs().previous(range.upperEndpoint());
        } else {
            return range.upperEndpoint();
        }
    }