Define the range where move the iterator forward and backward.

@param iFrom
Lower bound limit of the range
@param iEnd
Upper bound limit of the range
@return
15655
public ORecordIteratorCluster<REC> setRange(final long iFrom, final long iEnd) {
		firstClusterPosition = iFrom;
		rangeTo = iEnd;
		current.clusterPosition = firstClusterPosition;
		return this;
	}
983311
public Query range(ByteStringRange range) {
    RowRange.Builder rangeBuilder = RowRange.newBuilder();

    switch (range.getStartBound()) {
      case OPEN:
        rangeBuilder.setStartKeyOpen(range.getStart());
        break;
      case CLOSED:
        rangeBuilder.setStartKeyClosed(range.getStart());
        break;
      case UNBOUNDED:
        rangeBuilder.clearStartKey();
        break;
      default:
        throw new IllegalStateException("Unknown start bound: " + range.getStartBound());
    }

    switch (range.getEndBound()) {
      case OPEN:
        rangeBuilder.setEndKeyOpen(range.getEnd());
        break;
      case CLOSED:
        rangeBuilder.setEndKeyClosed(range.getEnd());
        break;
      case UNBOUNDED:
        rangeBuilder.clearEndKey();
        break;
      default:
        throw new IllegalStateException("Unknown end bound: " + range.getEndBound());
    }

    builder.getRowsBuilder().addRowRanges(rangeBuilder.build());

    return this;
  }
1081751
public static IntList range(int start, int end, int step)
    {
        IntList l = new IntList((end-start)/step +1);
        for(int i = start; i < end; i++)
            l.add(i);
        return l;
    }
370124
public static RangeImpl range(
            EvaluationContext ctx,
            Range.RangeBoundary lowBoundary,
            Object lowEndPoint,
            Object highEndPoint,
            Range.RangeBoundary highBoundary) {

        Comparable left = asComparable(lowEndPoint);
        Comparable right = asComparable(highEndPoint);
        if (left == null || right == null || !compatible(left, right)) {
            ctx.notifyEvt(() -> new ASTEventBase(
                    FEELEvent.Severity.ERROR,
                    Msg.createMessage(
                            Msg.INCOMPATIBLE_TYPE_FOR_RANGE,
                            left.getClass().getSimpleName()
                    ),
                    null));
            return null;
        }
        return new RangeImpl(
                lowBoundary,
                left,
                right,
                highBoundary);
    }
647869
private final boolean forwardSearchRange(byte[]bytes, int str, int end, int s, int range, IntHolder lowPrev) {
        int pprev = -1;
        int p = s;

        if (Config.DEBUG_SEARCH) debugForwardSearchRange(str, end, s, range);

        if (regex.dMin > 0) {
            if (enc.isSingleByte()) {
                p += regex.dMin;
            } else {
                int q = p + regex.dMin;
                while (p < q && p < end) p += enc.length(bytes, p, end);
            }
        }

        retry:while (true) {
            if (Config.DEBUG_SEARCH) debugSearch(regex.forward.getName(), p, end, range);
            p = regex.forward.search(this, bytes, p, end, range);

            if (p != -1 && p < range) {
                if (p - regex.dMin < s) {
                    // retry_gate:
                    pprev = p;
                    p += enc.length(bytes, p, end);
                    continue retry;
                }

                if (regex.subAnchor != 0) {
                    switch (regex.subAnchor) {
                    case AnchorType.BEGIN_LINE:
                        if (p != str) {
                            int prev = enc.prevCharHead(bytes, (pprev != -1) ? pprev : str, p, end);
                            if (!enc.isNewLine(bytes, prev, end)) {
                                // goto retry_gate;
                                pprev = p;
                                p += enc.length(bytes, p, end);
                                continue retry;
                            }
                        }
                        break;

                    case AnchorType.END_LINE:
                        if (p == end) {
                            if (!Config.USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE) {
                                int prev = enc.prevCharHead(bytes, (pprev != -1) ? pprev : str, p, end);
                                if (prev != -1 && enc.isNewLine(bytes, prev, end)) {
                                    // goto retry_gate;
                                    pprev = p;
                                    p += enc.length(bytes, p, end);
                                    continue retry;
                                }
                            }
                        } else if (!enc.isNewLine(bytes, p, end) && (!Config.USE_CRNL_AS_LINE_TERMINATOR || !enc.isMbcCrnl(bytes, p, end))) {
                            //if () break;
                            // goto retry_gate;
                            pprev = p;
                            p += enc.length(bytes, p, end);
                            continue retry;
                        }
                        break;
                    } // switch
                }

                if (regex.dMax == 0) {
                    low = p;
                    if (lowPrev != null) { // ??? // remove null checks
                        if (low > s) {
                            lowPrev.value = enc.prevCharHead(bytes, s, p, end);
                        } else {
                            lowPrev.value = enc.prevCharHead(bytes, (pprev != -1) ? pprev : str, p, end);
                        }
                    }
                } else {
                    if (regex.dMax != MinMaxLen.INFINITE_DISTANCE) {
                        low = p - regex.dMax;

                        if (low > s) {
                            low = enc.rightAdjustCharHeadWithPrev(bytes, s, low, end, lowPrev);
                            if (lowPrev != null && lowPrev.value == -1) {
                                lowPrev.value = enc.prevCharHead(bytes, (pprev != -1) ? pprev : s, low, end);
                            }
                        } else {
                            if (lowPrev != null) {
                                lowPrev.value = enc.prevCharHead(bytes, (pprev != -1) ? pprev : str, low, end);
                            }
                        }
                    }
                }
                /* no needs to adjust *high, *high is used as range check only */
                high = p - regex.dMin;
                if (Config.DEBUG_SEARCH) debugForwardSearchRangeSuccess(str, low, high);
                return true;    /* success */
            }
            return false;   /* fail */
        } //while
    }
41522
@Pure
	public Iterator<P> iterator(Rectangle2afp<?, ?, ?, ?, ?, ?> bounds) {
		if (this.bounds.intersects(bounds)) {
			final int c1 = getColumnFor(bounds.getMinX());
			final int r1 = getRowFor(bounds.getMinY());
			final int c2 = getColumnFor(bounds.getMaxX());
			final int r2 = getRowFor(bounds.getMaxY());
			return new BoundedElementIterator(new CellIterator(r1, c1, r2, c2, false), -1, bounds);
		}
		return Collections.<P>emptyList().iterator();
	}
722882
@Override
	public BitStore range(int from, int to) {
		return store.range(from, to).immutableView();
	}
787081
public static int getCDSLengthForward(List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) {

		int codingLength = 0;

		for (int i = 0; i < exonStarts.size(); i++) {

			int start = exonStarts.get(i)+base;
			int end = exonEnds.get(i);

			if ( (start < cdsStart+base && end < cdsStart) || (start > cdsEnd && end > cdsEnd) )
				continue;

			if (start < cdsStart+base)
				start = cdsStart+base;

			if (end > cdsEnd)
				end = cdsEnd;

			codingLength += (end - start + 1);
		}
		return codingLength-3 ;
	}
856992
public int convertBoundaryToRelativePosition(int absolutePosition) {
        if (absolutePosition < lower || absolutePosition > upper)
            throw new IllegalArgumentException("Position outside this range (" + absolutePosition + ") this=" + this + ".");

        if (reversed)
            return upper - absolutePosition;
        else
            return absolutePosition - lower;
    }
1077719
@Override
    public boolean isBoundary(int offset) {
        checkOffset(offset, fText);

        // the beginning index of the iterator is always a boundary position by definition
        if (offset == fText.getBeginIndex()) {
            first();       // For side effects on current position, tag values.
            return true;
        }

        if (offset == fText.getEndIndex()) {
            last();       // For side effects on current position, tag values.
            return true;
        }

        // otherwise, we can use following() on the position before the specified
        // one and return true if the position we get back is the one the user
        // specified

        // return following(offset - 1) == offset;
        // TODO:  check whether it is safe to revert to the simpler offset-1 code
        //         The safe rules may take care of unpaired surrogates ok.
        fText.setIndex(offset);
        previous32(fText);
        int  pos = fText.getIndex();
        boolean result = following(pos) == offset;
        return result;
    }
917833
public static <T> KeyRange<T> greaterThanBackward(final T start) {
    return new KeyRange<>(KeyRangeType.BACKWARD_GREATER_THAN, start, null);
  }
1041548
private static long start(Range<Long> range) {
        if (range.lowerBoundType() == BoundType.OPEN) {
            return DiscreteDomain.longs().next(range.lowerEndpoint());
        } else {
            return range.lowerEndpoint();
        }
    }
61704
@Override
  public IVersionRange invert() {
    if (ranges.size() == 2) {
      IVersionRange irange1 = ranges.first().invert();
      IVersionRange irange2 = ranges.last().invert();
      return new AndRange(irange1, irange2);
    }

    throw new UnsupportedOperationException();
  }
629862
public Query<T> setRange(N start, N finish, boolean reversed, int count) {
    slicePredicate.setRange(start, finish, reversed, count);
    return this;
  }
357691
private boolean toBoundedPrevious() throws FetchException {
        if (!toPrevious()) {
            return false;
        }

        if (mStartBound != null) {
            byte[] currentKey = getCurrentKey();
            if (currentKey == null) {
                return false;
            }
            int result = compareKeysPartially(currentKey, mStartBound);
            if (result <= 0) {
                if (result < 0 || !mInclusiveStart) {
                    // Too far now, reset to first.
                    toBoundedFirst();
                    return false;
                }
            }
        }

        return prefixMatches();
    }
531661
public static <E> Iterator<E> asIterator(Enumeration<E> e) {
		return IterUtil.asIterator(e);
	}
979994
public static int cudnnActivationBackward(
        cudnnHandle handle, 
        cudnnActivationDescriptor activationDesc, 
        Pointer alpha, 
        cudnnTensorDescriptor yDesc, 
        Pointer y, 
        cudnnTensorDescriptor dyDesc, 
        Pointer dy, 
        cudnnTensorDescriptor xDesc, 
        Pointer x, 
        Pointer beta, 
        cudnnTensorDescriptor dxDesc, 
        Pointer dx)
    {
        return checkResult(cudnnActivationBackwardNative(handle, activationDesc, alpha, yDesc, y, dyDesc, dy, xDesc, x, beta, dxDesc, dx));
    }