交差判定

@param range 判定Range
@return 交差
555636
public boolean hasIntersection(final Range range) {
		return Math.max(this.start, range.start) <= Math.min(this.end, range.end);
	}
449399
public void setRange(String range) {
        String single = range.trim();
        int hyphenIndex = range.indexOf('-');

        if (hyphenIndex > 0) {
            this.start = rangeSingle(range.substring(0, hyphenIndex));
            this.end = rangeSingle(range.substring(hyphenIndex + 1));
        } else {
            int number = rangeSingle(range);
            if (number >= 0) { // first n attributes
                this.start = 0;
                this.end = number;
            } else { // last n attributes
                this.start = this.upperLimit + number > 0 ? this.upperLimit + number : 0;
                this.end = this.upperLimit - 1;
            }
        }
    }
1070981
public static boolean contains(Range range, Range subrange) {
        return range.getMinimum().doubleValue() <= subrange.getMinimum().doubleValue()
                && range.getMaximum().doubleValue() >= subrange.getMaximum().doubleValue();
        
    }
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);
    }
35749
public function range($range = null)
    {
        if (!func_num_args()) {
            return $this->_start . '-' . ($this->_limit ? $this->_start + $this->_limit : '');
        }
        $values = explode('-', $range);
        $this->_start = (int) $values[0];
        $this->_limit = $values[1] !== '' ? $values[1] - $values[0] : null;
        return $this;
    }
1111859
public static String getAt(String text, Range range) {
        RangeInfo info = subListBorders(text.length(), range);
        String answer = text.substring(info.from, info.to);
        if (info.reverse) {
            answer = reverse(answer);
        }
        return answer;
    }
1245184
@SuppressWarnings("unchecked")
    public static List<Boolean> getAt(boolean[] array, ObjectRange range) {
        return primitiveArrayGet(array, range);
    }
78203
private int[] range(int start, int end) {
        if (rangeList == null) {
            rangeList = new int[] { start, end+1, HIGH };
        } else {
            rangeList[0] = start;
            rangeList[1] = end+1;
        }
        return rangeList;
    }
928489
public Query range(String start, String end) {
    return range(wrapKey(start), wrapKey(end));
  }
1182809
function getCellByRange(range) {
  let cell = range.startContainer;

  if (domUtils.getNodeName(cell) === 'TD' || domUtils.getNodeName(cell) === 'TH') {
    cell = $(cell);
  } else {
    cell = $(cell).parentsUntil('tr');
  }

  return cell;
}
394236
public static Set<Integer> parseRange(String range) {
        if (range == null) {
            return Collections.emptySet();
        }
        Set<Integer> ret = new LinkedHashSet<>();
        StringTokenizer stringTokenizer = new StringTokenizer(range, String.format("%s%s", COMMA, DASH), true);
        Integer from = null;
        Integer to = null;
        boolean rangeStarted = false;
        while (stringTokenizer.hasMoreTokens()) {
            String token = stringTokenizer.nextToken();
            if (isValueDelimiter(token)) {
                ret.addAll(fromToAsSet(from, to));
                from = null;
                to = null;
                rangeStarted = false;
            } else if (isRangeDelimiter(token)) {
                rangeStarted = true;
            } else {
                String trimmedValue = token.trim();
                if (!isPositiveInt(trimmedValue)) {
                    throw new IllegalArgumentException("Range values should be positive numbers.");
                }
                Integer parsedInteger = Integer.parseUnsignedInt(trimmedValue);
                if (rangeStarted) {
                    to = parsedInteger;
                } else {
                    from = parsedInteger;
                }
            }
            if (from != null) {
                ret.addAll(fromToAsSet(from, to));
            }
        }

        return ret;
    }
997837
@SuppressWarnings("unchecked")
    public static List<Character> getAt(char[] array, ObjectRange range) {
        return primitiveArrayGet(array, range);
    }
496150
@Override
  public Collection<Range<T>> rangesContaining(final Range<T> queryRange) {
    final ImmutableSet.Builder<Range<T>> ret = ImmutableSet.builder();
    for (final Range<T> range : ranges) {
      if (range.encloses(queryRange)) {
        ret.add(range);
      }
    }
    return ret.build();
  }
201406
public Range intersection(final Range range) {
		int c0 = Math.max(this.start, range.start);
		int c1 = Math.min(this.end, range.end);
		return c0 <= c1 ? new Range(c0, c1) : null;
	}
1150635
public static boolean isClosed(final Range<?> range) {
    return range.hasUpperBound() && BoundType.CLOSED.equals(range.upperBoundType())
        && range.hasLowerBound() && BoundType.CLOSED.equals(range.lowerBoundType());
  }
1359724
public static boolean contains(Range range, double value) {
        return value >= range.getMinimum().doubleValue() && value <= range.getMaximum().doubleValue();
    }
759958
public Range<App> listApps(String range) {
        return connection.execute(new AppList(range), apiKey);
    }