Home
last modified time | relevance | path

Searched refs:range (Results 1 – 25 of 156) sorted by relevance

1234567

/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DIntSliceOpTest.java59 assertCountSum(IntStream.range(0, 0).skip(0).boxed(), 0, 0); in testSkip()
60 assertCountSum(IntStream.range(0, 0).skip(4).boxed(), 0, 0); in testSkip()
61 assertCountSum(IntStream.range(1, 5).skip(4).boxed(), 0, 0); in testSkip()
62 assertCountSum(IntStream.range(1, 5).skip(2).boxed(), 2, 7); in testSkip()
63 assertCountSum(IntStream.range(1, 5).skip(0).boxed(), 4, 10); in testSkip()
65 assertCountSum(IntStream.range(0, 0).parallel().skip(0).boxed(), 0, 0); in testSkip()
66 assertCountSum(IntStream.range(0, 0).parallel().skip(4).boxed(), 0, 0); in testSkip()
67 assertCountSum(IntStream.range(1, 5).parallel().skip(4).boxed(), 0, 0); in testSkip()
68 assertCountSum(IntStream.range(1, 5).parallel().skip(2).boxed(), 2, 7); in testSkip()
69 assertCountSum(IntStream.range(1, 5).parallel().skip(0).boxed(), 4, 10); in testSkip()
[all …]
DConcatOpTest.java59 LongStream.range(0, Long.MAX_VALUE / 2).boxed(), in testSize()
60 LongStream.range(0, Long.MAX_VALUE / 2).boxed())); in testSize()
63 LongStream.range(0, Long.MAX_VALUE).boxed(), in testSize()
64 LongStream.range(0, Long.MAX_VALUE).boxed())); in testSize()
67 LongStream.range(0, Long.MAX_VALUE).boxed(), in testSize()
72 LongStream.range(0, Long.MAX_VALUE).boxed())); in testSize()
77 LongStream.range(0, Long.MAX_VALUE / 2), in testLongSize()
78 LongStream.range(0, Long.MAX_VALUE / 2))); in testLongSize()
81 LongStream.range(0, Long.MAX_VALUE), in testLongSize()
82 LongStream.range(0, Long.MAX_VALUE))); in testLongSize()
[all …]
DLongPrimitiveOpsTests.java42 long sum = LongStream.range(1, 10).filter(i -> i % 2 == 0).sum(); in testSum()
47 long sum = LongStream.range(1, 10).filter(i -> i % 2 == 0).map(i -> i * 2).sum(); in testMap()
52 long sum = LongStream.range(1, 10).parallel().filter(i -> i % 2 == 0).sum(); in testParSum()
59 …long sum = LongStream.range(1, 10).filter(i -> i % 2 == 0).peek(i -> { teeSum[0] = teeSum[0] + i; … in testTee()
66 LongStream.range(1, 10).filter(i -> i % 2 == 0).forEach(i -> { sum[0] = sum[0] + i; }); in testForEach()
73 LongStream.range(1, 10).parallel().filter(i -> i % 2 == 0).forEach(ai::addAndGet); in testParForEach()
78 List<Long> l = LongStream.range(1, 10).parallel().boxed().collect(Collectors.toList()); in testBox()
90 long[] array = LongStream.range(1, 10).map(i -> i * 2).toArray(); in testToArray()
95 long[] array = LongStream.range(1, 10).parallel().map(i -> i * 2).toArray(); in testToArray()
138 long[] expected = LongStream.range(1, 1000).toArray(); in testSequential()
[all …]
DIntPrimitiveOpsTests.java42 long sum = IntStream.range(1, 10).filter(i -> i % 2 == 0).sum(); in testSum()
47 long sum = IntStream.range(1, 10).filter(i -> i % 2 == 0).map(i -> i * 2).sum(); in testMap()
52 long sum = IntStream.range(1, 10).parallel().filter(i -> i % 2 == 0).sum(); in testParSum()
59 …long sum = IntStream.range(1, 10).filter(i -> i % 2 == 0).peek(i -> { teeSum[0] = teeSum[0] + i; }… in testTee()
66 IntStream.range(1, 10).filter(i -> i % 2 == 0).forEach(i -> { sum[0] = sum[0] + i; }); in testForEach()
73 IntStream.range(1, 10).parallel().filter(i -> i % 2 == 0).forEach(ai::addAndGet); in testParForEach()
78 List<Integer> l = IntStream.range(1, 10).parallel().boxed().collect(Collectors.toList()); in testBox()
90 int[] array = IntStream.range(1, 10).map(i -> i * 2).toArray(); in testToArray()
95 int[] array = IntStream.range(1, 10).parallel().map(i -> i * 2).toArray(); in testToArray()
138 int[] expected = IntStream.range(1, 1000).toArray(); in testSequential()
[all …]
DStreamBuilderTest.java94 IntStream.range(0, size).boxed().forEach(sb); in testAfterBuilding()
106 IntStream.range(0, s).boxed().forEach(sb); in testStreamBuilder()
112 IntStream.range(0, s).boxed().forEach(i -> { in testStreamBuilder()
126 expectedResult(IntStream.range(0, size).boxed().collect(toList())). in testStreamBuilder()
131 expectedResult(IntStream.range(0, size).boxed().collect(toList())). in testStreamBuilder()
156 IntStream.range(0, size).forEach(sb); in testIntAfterBuilding()
168 IntStream.range(0, s).forEach(sb); in testIntStreamBuilder()
174 IntStream.range(0, s).forEach(i -> { in testIntStreamBuilder()
188 expectedResult(IntStream.range(0, size).toArray()). in testIntStreamBuilder()
193 expectedResult(IntStream.range(0, size).toArray()). in testIntStreamBuilder()
[all …]
DMatchOpTest.java192 …assertIntPredicates(() -> IntStream.range(0, 0), Kind.ANY, INT_PREDICATES, false, false, false, fa… in testIntStreamMatches()
193 …assertIntPredicates(() -> IntStream.range(0, 0), Kind.ALL, INT_PREDICATES, true, true, true, true); in testIntStreamMatches()
194 …assertIntPredicates(() -> IntStream.range(0, 0), Kind.NONE, INT_PREDICATES, true, true, true, true… in testIntStreamMatches()
196 …assertIntPredicates(() -> IntStream.range(1, 2), Kind.ANY, INT_PREDICATES, true, false, false, tru… in testIntStreamMatches()
197 …assertIntPredicates(() -> IntStream.range(1, 2), Kind.ALL, INT_PREDICATES, true, false, false, tru… in testIntStreamMatches()
198 …assertIntPredicates(() -> IntStream.range(1, 2), Kind.NONE, INT_PREDICATES, false, true, true, fal… in testIntStreamMatches()
200 …assertIntPredicates(() -> IntStream.range(1, 6), Kind.ANY, INT_PREDICATES, true, false, true, true… in testIntStreamMatches()
201 …assertIntPredicates(() -> IntStream.range(1, 6), Kind.ALL, INT_PREDICATES, true, false, false, fal… in testIntStreamMatches()
202 …assertIntPredicates(() -> IntStream.range(1, 6), Kind.NONE, INT_PREDICATES, false, true, false, fa… in testIntStreamMatches()
277 …assertLongPredicates(() -> LongStream.range(0, 0), Kind.ANY, LONG_PREDICATES, false, false, false,… in testLongStreamMatches()
[all …]
DCountLargeTest.java44 long count = LongStream.range(0, EXPECTED_LARGE_COUNT) in testRefLarge()
51 long count = LongStream.range(0, EXPECTED_LARGE_COUNT) in testIntLarge()
58 long count = LongStream.range(0, EXPECTED_LARGE_COUNT) in testLongLarge()
65 long count = LongStream.range(0, EXPECTED_LARGE_COUNT) in testDoubleLarge()
DExplodeOpTest.java56 = e -> IntStream.range(0, e).boxed();
84 exerciseOps(data, s -> s.flatMap((Integer e) -> IntStream.range(0, e).boxed().limit(10))); in testOps()
98 exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, e))); in testIntOps()
99 exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, e).limit(10))); in testIntOps()
113 exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e))); in testLongOps()
114 exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e).limit(10))); in testLongOps()
128 exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).asDoubleStream())); in testDoubleOps()
129 … exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).limit(10).asDoubleStream())); in testDoubleOps()
DMinMaxTest.java70 assertEquals(1, IntStream.range(1, 1001).min().getAsInt()); in testIntMinMax()
71 assertEquals(1000, IntStream.range(1, 1001).max().getAsInt()); in testIntMinMax()
83 assertEquals(1, LongStream.range(1, 1001).min().getAsLong()); in testLongMinMax()
84 assertEquals(1000, LongStream.range(1, 1001).max().getAsLong()); in testLongMinMax()
96 assertEquals(1.0, LongStream.range(1, 1001).asDoubleStream().min().getAsDouble()); in testDoubleMinMax()
97 assertEquals(1000.0, LongStream.range(1, 1001).asDoubleStream().max().getAsDouble()); in testDoubleMinMax()
/libcore/ojluni/src/main/java/sun/util/locale/
DLocaleMatcher.java85 String range = lr.getRange(); in filterTags() local
86 if (range.startsWith("*-") in filterTags()
87 || range.indexOf("-*") != -1) { // Extended range in filterTags()
91 if (range.charAt(0) == '*') { in filterTags()
92 range = "*"; in filterTags()
94 range = range.replaceAll("-[*]", ""); in filterTags()
96 list.add(new LanguageRange(range, lr.getWeight())); in filterTags()
99 + range in filterTags()
126 String range = lr.getRange(); in filterBasic() local
127 if (range.equals("*")) { in filterBasic()
[all …]
/libcore/luni/src/test/java/libcore/java/time/chrono/
DThaiBuddhistChronologyTest.java47 ChronoField.PROLEPTIC_MONTH.range().getMinimum() + YEARS_AHEAD * 12L, in test_range()
48 ChronoField.PROLEPTIC_MONTH.range().getMaximum() + YEARS_AHEAD * 12L); in test_range()
54 .of(1, -ChronoField.YEAR.range().getMinimum() + 1 - YEARS_AHEAD, in test_range()
55 ChronoField.YEAR.range().getMaximum() + YEARS_AHEAD); in test_range()
59 expected = ValueRange.of(ChronoField.YEAR.range().getMinimum() + YEARS_AHEAD, in test_range()
60 ChronoField.YEAR.range().getMaximum() + YEARS_AHEAD); in test_range()
64 expected = field.range(); in test_range()
68 ThaiBuddhistChronology.INSTANCE.range(field)); in test_range()
95 assertEquals(LocalDate.from(date).range(ChronoField.DAY_OF_MONTH), in test_ThaiBuddhistDate_range()
96 date.range(ChronoField.DAY_OF_MONTH)); in test_ThaiBuddhistDate_range()
[all …]
DMinguoChronologyTest.java49 ChronoField.PROLEPTIC_MONTH.range().getMinimum() - YEARS_BEHIND * 12L, in test_range()
50 ChronoField.PROLEPTIC_MONTH.range().getMaximum() - YEARS_BEHIND * 12L); in test_range()
55 … expected = ValueRange.of(1, ChronoField.YEAR.range().getMaximum() - YEARS_BEHIND, in test_range()
56 -ChronoField.YEAR.range().getMinimum() + 1 + YEARS_BEHIND); in test_range()
60 expected = ValueRange.of(ChronoField.YEAR.range().getMinimum() - YEARS_BEHIND, in test_range()
61 ChronoField.YEAR.range().getMaximum() - YEARS_BEHIND); in test_range()
65 expected = field.range(); in test_range()
68 assertEquals("Range of " + field, expected, MinguoChronology.INSTANCE.range(field)); in test_range()
95 assertEquals(LocalDate.from(date).range(ChronoField.DAY_OF_MONTH), in test_MinguoDate_range()
96 date.range(ChronoField.DAY_OF_MONTH)); in test_MinguoDate_range()
[all …]
/libcore/benchmarks/src/benchmarks/
DImtConflictBenchmarkGen.py69 for i in range(max_conflict_depth):
71 for j in range(i+1):
76 for i in range(max_conflict_depth):
82 for j in range(max_conflict_depth):
88 for i in range(max_conflict_depth):
92 for i in range(max_conflict_depth):
93 interfaces = ", ".join(["I{}".format(j) for j in range(i+1)])
97 for i in range(max_conflict_depth):
99 for j in range(imt_size):
/libcore/ojluni/src/main/java/java/time/temporal/
DTemporalAccessor.java169 default ValueRange range(TemporalField field) { in range() method
172 return field.range(); in range()
218 ValueRange range = range(field); in get() local
219 if (range.isIntValue() == false) { in get()
223 if (range.isValidValue(value) == false) { in get()
224 …throw new DateTimeException("Invalid value for " + field + " (valid values " + range + "): " + val… in get()
DJulianFields.java228 private final transient ValueRange range; field in JulianFields.Field
235 this.range = ValueRange.of(-365243219162L + offset, 365241780471L + offset); in Field()
261 public ValueRange range() { in range() method in JulianFields.Field
262 return range; in range()
276 return range(); in rangeRefinedBy()
287 if (range().isValidValue(newValue) == false) { in adjustInto()
302 range().checkValidValue(value, this); in resolve()
DChronoField.java618 private final ValueRange range; field in ChronoField
621 …private ChronoField(String name, TemporalUnit baseUnit, TemporalUnit rangeUnit, ValueRange range) { in ChronoField() argument
625 this.range = range; in ChronoField()
630 ValueRange range, String displayNameKey) { in ChronoField() argument
634 this.range = range; in ChronoField()
718 public ValueRange range() { in range() method in ChronoField
719 return range; in range()
763 return range().checkValidValue(value, this); in checkValidValue()
782 return range().checkValidIntValue(value, this); in checkValidIntValue()
793 return temporal.range(this); in rangeRefinedBy()
DWeekFields.java737 …ayOfField("WeekBasedYear", weekDef, IsoFields.WEEK_BASED_YEARS, FOREVER, ChronoField.YEAR.range()); in ofWeekBasedYearField()
768 private final ValueRange range; field in WeekFields.ComputedDayOfField
770 …String name, WeekFields weekDef, TemporalUnit baseUnit, TemporalUnit rangeUnit, ValueRange range) { in ComputedDayOfField() argument
775 this.range = range; in ComputedDayOfField()
843 ValueRange dayRange = temporal.range(DAY_OF_YEAR); in localizedWeekBasedYear()
876 ValueRange dayRange = temporal.range(DAY_OF_YEAR); in localizedWeekOfWeekBasedYear()
921 int newVal = range.checkValidIntValue(newValue, this); // lenient check range in adjustInto()
948 … final int checkedValue = range.checkValidIntValue(value, this); // no leniency as too complex in resolve()
993 int womInt = range.checkValidIntValue(wom, this); // validate in resolveWoM()
1016 int womInt = range.checkValidIntValue(woy, this); // validate in resolveWoY()
[all …]
DIsoFields.java307 public ValueRange range() { in range() method
329 return range(); in rangeRefinedBy()
346range().checkValidValue(newValue, this); // leniently check from 1 to 92 TODO: check in adjustInto()
365 … int qoy = QUARTER_OF_YEAR.range().checkValidIntValue(qoyLong, QUARTER_OF_YEAR); // validated in resolve()
371range().checkValidValue(doq, this); // allow 1-92 rolling into next quarter in resolve()
396 public ValueRange range() { in range() method
422 range().checkValidValue(newValue, this); // strictly check from 1 to 4 in adjustInto()
460 public ValueRange range() { in range() method
485 range().checkValidValue(newValue, this); // lenient range in adjustInto()
496 …int wby = WEEK_BASED_YEAR.range().checkValidIntValue(wbyLong, WEEK_BASED_YEAR); // always validate in resolve()
[all …]
/libcore/ojluni/src/main/java/java/time/chrono/
DMinguoChronology.java314 public ValueRange range(ChronoField field) { in range() method in MinguoChronology
317 ValueRange range = PROLEPTIC_MONTH.range(); in range() local
318 …return ValueRange.of(range.getMinimum() - YEARS_DIFFERENCE * 12L, range.getMaximum() - YEARS_DIFFE… in range()
321 ValueRange range = YEAR.range(); in range() local
322 …return ValueRange.of(1, range.getMaximum() - YEARS_DIFFERENCE, -range.getMinimum() + 1 + YEARS_DIF… in range()
325 ValueRange range = YEAR.range(); in range() local
326 …return ValueRange.of(range.getMinimum() - YEARS_DIFFERENCE, range.getMaximum() - YEARS_DIFFERENCE); in range()
329 return field.range(); in range()
DThaiBuddhistChronology.java350 public ValueRange range(ChronoField field) { in range() method in ThaiBuddhistChronology
353 ValueRange range = PROLEPTIC_MONTH.range(); in range() local
354 …return ValueRange.of(range.getMinimum() + YEARS_DIFFERENCE * 12L, range.getMaximum() + YEARS_DIFFE… in range()
357 ValueRange range = YEAR.range(); in range() local
358 …return ValueRange.of(1, -(range.getMinimum() + YEARS_DIFFERENCE) + 1, range.getMaximum() + YEARS_D… in range()
361 ValueRange range = YEAR.range(); in range() local
362 …return ValueRange.of(range.getMinimum() + YEARS_DIFFERENCE, range.getMaximum() + YEARS_DIFFERENCE); in range()
365 return field.range(); in range()
DAbstractChronology.java489 yoe = range(YEAR_OF_ERA).checkValidIntValue(yoeLong, YEAR_OF_ERA); in resolveYearOfEra()
494 Era eraObj = eraOf(range(ERA).checkValidIntValue(eraLong, ERA)); in resolveYearOfEra()
498 int year = range(YEAR).checkValidIntValue(fieldValues.get(YEAR), YEAR); in resolveYearOfEra()
516 range(ERA).checkValidValue(fieldValues.get(ERA), ERA); // always validated in resolveYearOfEra()
522 int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); in resolveYMD()
528 …int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR… in resolveYMD()
529 ValueRange domRange = range(DAY_OF_MONTH); in resolveYMD()
542 int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); in resolveYD()
547 … int doy = range(DAY_OF_YEAR).checkValidIntValue(fieldValues.remove(DAY_OF_YEAR), DAY_OF_YEAR); in resolveYD()
552 int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); in resolveYMAA()
[all …]
DThaiBuddhistDate.java254 public ValueRange range(TemporalField field) { in range() method in ThaiBuddhistDate
262 return isoDate.range(field); in range()
264 ValueRange range = YEAR.range(); in range() local
265 …long max = (getProlepticYear() <= 0 ? -(range.getMinimum() + YEARS_DIFFERENCE) + 1 : range.getMaxi… in range()
269 return getChronology().range(f); in range()
313 getChronology().range(chronoField).checkValidValue(newValue, chronoField); in with()
318 … int nvalue = getChronology().range(chronoField).checkValidIntValue(newValue, chronoField); in with()
/libcore/luni/src/test/java/libcore/java/time/
DZoneOffsetTest.java47 assertEquals(ChronoField.OFFSET_SECONDS.range(), in test_range()
48 OFFSET_P1.range(ChronoField.OFFSET_SECONDS)); in test_range()
53 OFFSET_P1.range(null); in test_range_null()
64 OFFSET_P1.range(field); in test_range_unsupported()
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/
DTCKJapaneseEra.java131 assertEquals(era.range(ERA).getMinimum(), -1); in test_range()
132 assertEquals(era.range(ERA).getLargestMinimum(), -1); in test_range()
133 assertEquals(era.range(ERA).getSmallestMaximum(), era.range(ERA).getMaximum()); in test_range()
134 assertEquals(era.range(ERA).getMaximum() >= 2, true); in test_range()
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/
DSliceSpliteratorTest.java74 … final Collection<Integer> source = IntStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
87 … final Collection<Integer> source = IntStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
100 … final Collection<Long> source = LongStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
113 …final Collection<Double> source = LongStream.range(0, size).asDoubleStream().boxed().collect(toLi… in sliceSpliteratorDataProvider()
129 … final Collection<Integer> source = IntStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
143 … final Collection<Integer> source = IntStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
157 … final Collection<Long> source = LongStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
171 …final Collection<Double> source = LongStream.range(0, size).asDoubleStream().boxed().collect(toLi… in sliceSpliteratorDataProvider()
175 … Spliterator.OfDouble s = Arrays.spliterator(LongStream.range(0, SIZE).asDoubleStream().toArray()); in sliceSpliteratorDataProvider()

1234567