Returns a string that represents a valid Solr query range.

@param from Lower bound of the query range.
@param to Upper bound of the query range.
@return String that represents a Solr query range.
163125
public static String getSolrRangeString(String from, String to) {

        // If a parameter is not initialized, use the asterisk '*' operator
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(from)) {
            from = "*";
        }

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(to)) {
            to = "*";
        }

        return String.format("[%s TO %s]", from, to);
    }
901779
int firstZeroInRange(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 firstZeroInRangeAdj(from, to) - start;
	}
847880
public T between(Object low, Object hi) {
        return _withComparisonOperator(ComparisonOperator.BETWEEN)._withValues(low, hi);
    }
36869
public Range convertToSeq1Range(Range rangeInSeq2) {
        int from = aabs(convertToSeq1Position(rangeInSeq2.getFrom()));
        int to = aabs(convertToSeq1Position(rangeInSeq2.getTo()));

        if (from == -1 || to == -1)
            return null;

        return new Range(from, to);
    }
1169366
public static void checkIndex(final int from, final int until, final int size) {
		if (from < 0) {
			throw new ArrayIndexOutOfBoundsException("fromIndex = " + from);
		}
		if (until > size) {
			throw new ArrayIndexOutOfBoundsException(format(
				"Invalid index range: [%d, %s)", from, until
			));
		}
		if (from > until) {
			throw new IllegalArgumentException(format(
				"fromIndex(%d) > toIndex(%d)", from, until
			));
		}
	}
193426
public Map<String, String> rangeQueryState(String startKey, String endKey) {
        Map<String, String> retMap = new HashMap<>();
        for (Map.Entry<String, ByteString> item : rangeQueryRawState(startKey, endKey).entrySet()) {
            retMap.put(item.getKey(), item.getValue().toStringUtf8());
        }
        return retMap;
    }
1034911
public Range convertToSeq2Range(Range rangeInSeq1) {
        int from = aabs(convertToSeq2Position(rangeInSeq1.getFrom()));
        int to = aabs(convertToSeq2Position(rangeInSeq1.getTo()));

        if (from == -1 || to == -1)
            return null;

        return new Range(from, to);
    }
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;
	}
1102508
private int findIndexOfFrom(String query) {
    if (query.startsWith("from")) return 0;
    int fromIdx = query.indexOf(" from ");
    if (-1 == fromIdx) return -1;
    final int first = query.substring(0, fromIdx).indexOf("(");
    if (first > 0) {
      int leftCnt = 1;
      int i = first + 1;
      while (leftCnt != 0 && i < query.length()) {
        if (query.charAt(i) == '(') leftCnt++;
        else if (query.charAt(i) == ')') leftCnt--;
        i++;
      }
      if (leftCnt > 0) return -1;
      else {
        fromIdx = query.indexOf(" from ", i);
        return (fromIdx == -1) ? -1 : fromIdx + 1;
      }
    } else {
      return fromIdx + 1;
    }
  }
909763
public function range($from, $to, $condition = true) {
		$range = new Range($this, !$condition);
		$range->setFrom($from);
		$range->setTo($to);
		return $range;
	}
1093821
private boolean areTypesSame(String from, String to)
   {
      String fromCompare = from.endsWith(".java") ? from.substring(0, from.length() - 5) : from;
      String toCompare = to.endsWith(".java") ? to.substring(0, to.length() - 5) : to;
      return fromCompare.equals(toCompare);
   }
1344718
public WrappedLBuffer view(long from, long to) {
        if(from > to)
            throw new IllegalArgumentException(String.format("invalid range %,d to %,d", from, to));

        return new WrappedLBuffer(m, from + offset(), to - from);
    }
1370955
def checkQueryRange(self, start, end):
        
        condition = (
            (start < 0 or end > self.getLength()) or
            start > end or start == end)
        if condition:
            raise exceptions.ReferenceRangeErrorException(
                self.getId(), start, end)
1089186
public VersionRange range(final int... parts) {
    checkNotNull(parts);
    checkArgument(parts.length != 0);

    StringBuilder buff = new StringBuilder()
        .append("[");

    for (int i = 0; i < parts.length; i++) {
      buff.append(parts[i]);
      if (i + 1 < parts.length) {
        buff.append(".");
      }
    }

    buff.append(",");

    for (int i = 0; i < parts.length; i++) {
      if (i + 1 == parts.length) {
        buff.append(parts[i] + 1);
      }
      else {
        buff.append(parts[i])
            .append(".");
      }
    }

    buff.append(")");

    log.trace("Range pattern: {}", buff);

    return parseRange(buff.toString());
  }
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;
    }
166448
public String buildRangeString() {
        String lowerBoundString = "";
        if (this.lowerBoundBytes > -1) {
            lowerBoundString = String.valueOf(this.lowerBoundBytes);
        }

        String upperBoundString = "";
        if (this.upperBoundBytes > -1) {
            upperBoundString = String.valueOf(this.upperBoundBytes);
        }
        String rangeString = String.format("%s,%s", lowerBoundString, upperBoundString);
        if (rangeString == ",") {
            rangeString = null;
        }
        return rangeString;
    }
734405
public IVersionRange getRange(Collection<String> versions) throws InvalidRangeException {
    if (versions == null) {
      return null;
    }
    return getRange(versions.toArray(new String[versions.size()]));
  }