Support the subscript operator with a range for a boolean array

@param array a boolean array
@param range a range indicating the indices for the items to retrieve
@return list of the retrieved booleans
@since 1.0
184327
@SuppressWarnings("unchecked")
    public static List<Boolean> getAt(boolean[] array, Range range) {
        return primitiveArrayGet(array, range);
    }
1344612
@SuppressWarnings("unchecked")
    public static List<Byte> getAt(byte[] array, Range range) {
        return primitiveArrayGet(array, range);
    }
6580
public static <T extends Comparable<T>> RangeSet<T> unionRanges(final Iterable<Range<T>> ranges)
  {
    RangeSet<T> rangeSet = null;
    for (Range<T> range : ranges) {
      if (rangeSet == null) {
        rangeSet = TreeRangeSet.create();
      }
      rangeSet.add(range);
    }
    return rangeSet;
  }
1014019
@SuppressWarnings("unchecked")
    public static List<Long> getAt(long[] array, Range range) {
        return primitiveArrayGet(array, range);
    }
302671
@SuppressWarnings("unchecked")
    public static List<Byte> getAt(byte[] array, ObjectRange range) {
        return primitiveArrayGet(array, range);
    }
57707
public static boolean isValid(Range range) {
        if (range == null) {
            return false;
        }
        
        double min = range.getMinimum().doubleValue();
        double max = range.getMaximum().doubleValue();
        
        return min != max && !Double.isNaN(min) && !Double.isInfinite(min) &&
                !Double.isNaN(max) && !Double.isInfinite(max);
    }
896301
public static boolean isDisjoint(Collection<Range> ranges) {
        List<Range> rangesList = new ArrayList<Range>(ranges.size());
        rangesList.addAll(ranges);
        Collections.sort(rangesList);
        for (int i = 0; i < rangesList.size() - 1; i++) {
            Range rCurrent = rangesList.get(i);
            Range rNext = rangesList.get(i+1);
            if (rCurrent.overlapsWith(rNext)) {
                return false;
            }
        }
        return true;
    }
997837
@SuppressWarnings("unchecked")
    public static List<Character> getAt(char[] array, ObjectRange range) {
        return primitiveArrayGet(array, range);
    }
840222
public static function fromArray(array $range)
    {
        $startType = null;
        $start = null;
        if (array_key_exists('startClosed', $range)) {
            $startType = self::TYPE_CLOSED;
            $start = $range['startClosed'];
        } elseif (array_key_exists('startOpen', $range)) {
            $startType = self::TYPE_OPEN;
            $start = $range['startOpen'];
        }

        $endType = null;
        $end = null;
        if (array_key_exists('endClosed', $range)) {
            $endType = self::TYPE_CLOSED;
            $end = $range['endClosed'];
        } elseif (array_key_exists('endOpen', $range)) {
            $endType = self::TYPE_OPEN;
            $end = $range['endOpen'];
        }

        return new self(array_filter([
            'startType' => $startType,
            'start' => $start,
            'endType' => $endType,
            'end' => $end
        ]));
    }
434212
public boolean inRanges(Instance instance, double[][] ranges) {
    boolean isIn = true;
    
    // updateRangesFirst must have been called on ranges
    for (int j = 0; isIn && (j < ranges.length); j++) {
      if (!instance.isMissing(j)) {
        double value = instance.value(j);
        isIn = value <= ranges[j][R_MAX];
        if (isIn) isIn = value >= ranges[j][R_MIN];
      }
    }
    
    return isIn;
  }
805183
public function getInRange($range = null) {
        if(is_null($range))
            $range = $this->range;
        $current_range = array( ($this->current_page-$range < 1 ? 1 : $this->current_page-$range),
            ($this->current_page+$range > $this->getMax() ? $this->getMax() : $this->current_page+$range));
        $rangeIDs = array();
        for($x = $current_range[0]; $x <= $current_range[1]; ++$x) {
            $rangeIDs[] = $x;
        }
        return $rangeIDs;
    }
471439
@SuppressWarnings("unchecked")
    public static List<Short> getAt(short[] array, Range range) {
        return primitiveArrayGet(array, range);
    }
1258756
def parse_range_list(ranges):
    
    if not ranges:
        return []
    parts = ranges.split(',')
    out = []
    for part in parts:
        fields = part.split('-', 1)
        if len(fields) == 2:
            start = int(fields[0])
            end = int(fields[1])
            out.extend(range(start, end + 1))
        else:
            out.append(int(fields[0]))
    return out
201317
public List<InetAddress> getEndpoint(Range<Token> range)
    {
        return (List<InetAddress>) rangeMap.get(range);
    }
438477
public static CharRanges withRanges(int... ranges) {
    if ((ranges.length & 1) != 0) { throw new IllegalArgumentException(); }
    for (int i = 1; i < ranges.length; ++i) {
      if (ranges[i] <= ranges[i - 1]) {
        throw new IllegalArgumentException(ranges[i] + " > " + ranges[i - 1]);
      }
    }
    return new CharRanges(ranges);
  }
43129
public static List<Long> lengths(final Iterable<Range<Long>> ranges) {
        checkNotNull(ranges);
        List<Long> lengths = new ArrayList<Long>();
        for (Range<Long> range : ranges) {
            lengths.add(length(range));
        }
        return lengths;
    }
790665
public Query query(Schema schema, Query range) {

        BooleanQuery.Builder builder = new BooleanQuery.Builder();
        if (range != null) {
            builder.add(range, FILTER);
        }

        filter.forEach(condition -> builder.add(condition.query(schema), FILTER));
        query.forEach(condition -> builder.add(condition.query(schema), MUST));

        BooleanQuery booleanQuery = builder.build();
        return booleanQuery.clauses().isEmpty() ? new MatchAllDocsQuery() : booleanQuery;
    }