Lines Matching refs:Range

33 import android.util.Range;
63 public static <T extends Comparable<? super T>> void sortDistinctRanges(Range<T>[] ranges) { in sortDistinctRanges()
64 Arrays.sort(ranges, new Comparator<Range<T>>() { in sortDistinctRanges()
66 public int compare(Range<T> lhs, Range<T> rhs) { in sortDistinctRanges()
85 Range<T>[] intersectSortedDistinctRanges(Range<T>[] one, Range<T>[] another) { in intersectSortedDistinctRanges()
87 Vector<Range<T>> result = new Vector<Range<T>>(); in intersectSortedDistinctRanges()
88 for (Range<T> range: another) { in intersectSortedDistinctRanges()
105 return result.toArray(new Range[result.size()]); in intersectSortedDistinctRanges()
117 int binarySearchDistinctRanges(Range<T>[] ranges, T value) { in binarySearchDistinctRanges()
118 return Arrays.binarySearch(ranges, Range.create(value, value), in binarySearchDistinctRanges()
119 new Comparator<Range<T>>() { in binarySearchDistinctRanges()
121 public int compare(Range<T> lhs, Range<T> rhs) { in binarySearchDistinctRanges()
157 static Range<Integer>factorRange(Range<Integer> range, int factor) {
161 return Range.create(divUp(range.getLower(), factor), range.getUpper() / factor);
168 static Range<Long>factorRange(Range<Long> range, long factor) {
172 return Range.create(divUp(range.getLower(), factor), range.getUpper() / factor);
184 static Range<Rational> scaleRange(Range<Rational> range, int num, int den) {
188 return Range.create(
193 static Range<Integer> alignRange(Range<Integer> range, int align) {
217 static Range<Integer> intRangeFor(double v) {
218 return Range.create((int)v, (int)Math.ceil(v));
221 static Range<Long> longRangeFor(double v) {
222 return Range.create((long)v, (long)Math.ceil(v));
252 static Range<Integer> parseIntRange(Object o, Range<Integer> fallback) {
260 return Range.create(
265 return Range.create(value, value);
274 static Range<Long> parseLongRange(Object o, Range<Long> fallback) {
282 return Range.create(
287 return Range.create(value, value);
296 static Range<Rational> parseRationalRange(Object o, Range<Rational> fallback) {
304 return Range.create(
309 return Range.create(value, value);