Home
last modified time | relevance | path

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

12345

/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 …]
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 …]
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 …]
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 …]
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()
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 …]
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.java86 String range = lr.getRange(); in filterTags() local
87 if (range.startsWith("*-") in filterTags()
88 || range.indexOf("-*") != -1) { // Extended range in filterTags()
92 if (range.charAt(0) == '*') { in filterTags()
93 range = "*"; in filterTags()
95 range = range.replaceAll("-[*]", ""); in filterTags()
97 list.add(new LanguageRange(range, lr.getWeight())); in filterTags()
100 + range in filterTags()
116 String range = lr.getRange(); in filterBasic() local
117 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.java47 ChronoField.PROLEPTIC_MONTH.range().getMinimum() - YEARS_BEHIND * 12L, in test_range()
48 ChronoField.PROLEPTIC_MONTH.range().getMaximum() - YEARS_BEHIND * 12L); in test_range()
53 … expected = ValueRange.of(1, ChronoField.YEAR.range().getMaximum() - YEARS_BEHIND, in test_range()
54 -ChronoField.YEAR.range().getMinimum() + 1 + YEARS_BEHIND); in test_range()
58 expected = ValueRange.of(ChronoField.YEAR.range().getMinimum() - YEARS_BEHIND, in test_range()
59 ChronoField.YEAR.range().getMaximum() - YEARS_BEHIND); in test_range()
63 expected = field.range(); in test_range()
66 assertEquals("Range of " + field, expected, MinguoChronology.INSTANCE.range(field)); in test_range()
93 assertEquals(LocalDate.from(date).range(ChronoField.DAY_OF_MONTH), in test_MinguoDate_range()
94 date.range(ChronoField.DAY_OF_MONTH)); in test_MinguoDate_range()
[all …]
/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.java224 private final transient ValueRange range; field in JulianFields.Field
231 this.range = ValueRange.of(-365243219162L + offset, 365241780471L + offset); in Field()
257 public ValueRange range() { in range() method in JulianFields.Field
258 return range; in range()
272 return range(); in rangeRefinedBy()
283 if (range().isValidValue(newValue) == false) { in adjustInto()
298 range().checkValidValue(value, this); in resolve()
DChronoField.java595 private final ValueRange range; field in ChronoField
598 …private ChronoField(String name, TemporalUnit baseUnit, TemporalUnit rangeUnit, ValueRange range) { in ChronoField() argument
602 this.range = range; in ChronoField()
607 ValueRange range, String displayNameKey) { in ChronoField() argument
611 this.range = range; in ChronoField()
685 public ValueRange range() { in range() method in ChronoField
686 return range; in range()
730 return range().checkValidValue(value, this); in checkValidValue()
749 return range().checkValidIntValue(value, this); in checkValidIntValue()
760 return temporal.range(this); in rangeRefinedBy()
DIsoFields.java300 public ValueRange range() { in range() method
322 return range(); in rangeRefinedBy()
339range().checkValidValue(newValue, this); // leniently check from 1 to 92 TODO: check in adjustInto()
358 … int qoy = QUARTER_OF_YEAR.range().checkValidIntValue(qoyLong, QUARTER_OF_YEAR); // validated in resolve()
364range().checkValidValue(doq, this); // allow 1-92 rolling into next quarter in resolve()
389 public ValueRange range() { in range() method
409 range().checkValidValue(newValue, this); // strictly check from 1 to 4 in adjustInto()
438 public ValueRange range() { in range() method
463 range().checkValidValue(newValue, this); // lenient range in adjustInto()
474 …int wby = WEEK_BASED_YEAR.range().checkValidIntValue(wbyLong, WEEK_BASED_YEAR); // always validate in resolve()
[all …]
DWeekFields.java712 …ayOfField("WeekBasedYear", weekDef, IsoFields.WEEK_BASED_YEARS, FOREVER, ChronoField.YEAR.range()); in ofWeekBasedYearField()
743 private final ValueRange range; field in WeekFields.ComputedDayOfField
745 …String name, WeekFields weekDef, TemporalUnit baseUnit, TemporalUnit rangeUnit, ValueRange range) { in ComputedDayOfField() argument
750 this.range = range; in ComputedDayOfField()
818 ValueRange dayRange = temporal.range(DAY_OF_YEAR); in localizedWeekBasedYear()
851 ValueRange dayRange = temporal.range(DAY_OF_YEAR); in localizedWeekOfWeekBasedYear()
896 int newVal = range.checkValidIntValue(newValue, this); // lenient check range in adjustInto()
923 … final int checkedValue = range.checkValidIntValue(value, this); // no leniency as too complex in resolve()
968 int womInt = range.checkValidIntValue(wom, this); // validate in resolveWoM()
991 int womInt = range.checkValidIntValue(woy, this); // validate in resolveWoY()
[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.java519 yoe = range(YEAR_OF_ERA).checkValidIntValue(yoeLong, YEAR_OF_ERA); in resolveYearOfEra()
524 Era eraObj = eraOf(range(ERA).checkValidIntValue(eraLong, ERA)); in resolveYearOfEra()
528 int year = range(YEAR).checkValidIntValue(fieldValues.get(YEAR), YEAR); in resolveYearOfEra()
546 range(ERA).checkValidValue(fieldValues.get(ERA), ERA); // always validated in resolveYearOfEra()
552 int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); in resolveYMD()
558 …int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR… in resolveYMD()
559 ValueRange domRange = range(DAY_OF_MONTH); in resolveYMD()
572 int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); in resolveYD()
577 … int doy = range(DAY_OF_YEAR).checkValidIntValue(fieldValues.remove(DAY_OF_YEAR), DAY_OF_YEAR); in resolveYD()
582 int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); in resolveYMAA()
[all …]
DMinguoDate.java253 public ValueRange range(TemporalField field) { in range() method in MinguoDate
261 return isoDate.range(field); in range()
263 ValueRange range = YEAR.range(); in range() local
264 …long max = (getProlepticYear() <= 0 ? -range.getMinimum() + 1 + YEARS_DIFFERENCE : range.getMaximu… in range()
268 return getChronology().range(f); in range()
313 getChronology().range(f).checkValidValue(newValue, f); in with()
318 int nvalue = getChronology().range(f).checkValidIntValue(newValue, f); in with()
DThaiBuddhistDate.java253 public ValueRange range(TemporalField field) { in range() method in ThaiBuddhistDate
261 return isoDate.range(field); in range()
263 ValueRange range = YEAR.range(); in range() local
264 …long max = (getProlepticYear() <= 0 ? -(range.getMinimum() + YEARS_DIFFERENCE) + 1 : range.getMaxi… in range()
268 return getChronology().range(f); in range()
313 getChronology().range(f).checkValidValue(newValue, f); in with()
318 int nvalue = getChronology().range(f).checkValidIntValue(newValue, f); in with()
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/
DTCKJapaneseEra.java117 assertEquals(era.range(ERA).getMinimum(), -1); in test_range()
118 assertEquals(era.range(ERA).getLargestMinimum(), -1); in test_range()
119 assertEquals(era.range(ERA).getSmallestMaximum(), era.range(ERA).getMaximum()); in test_range()
120 assertEquals(era.range(ERA).getMaximum() >= 2, true); in test_range()
/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/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()

12345