Searched refs:with (Results 1 - 25 of 77) sorted by relevance

1234

/libcore/luni/src/test/java/libcore/java/time/
H A DYearMonthTest.java5 * you may not use this file except in compliance with the License.
45 assertEquals(YearMonth.of(1000, Month.JANUARY), ym.with(ChronoField.YEAR, 1000));
46 assertEquals(YearMonth.of(-1, Month.JANUARY), ym.with(ChronoField.YEAR, -1));
47 assertEquals(YearMonth.of(2000, Month.FEBRUARY), ym.with(ChronoField.MONTH_OF_YEAR, 2));
49 bceYm.with(ChronoField.MONTH_OF_YEAR, 12));
50 assertSame(ym, ym.with(ChronoField.ERA, IsoEra.CE.getValue()));
51 assertSame(bceYm, bceYm.with(ChronoField.ERA, IsoEra.BCE.getValue()));
53 assertEquals(bceYm, ym.with(ChronoField.ERA, IsoEra.BCE.getValue()));
54 assertEquals(ym, bceYm.with(ChronoField.ERA, IsoEra.CE.getValue()));
55 assertEquals(YearMonth.of(1, Month.JANUARY), ym.with(ChronoFiel
[all...]
/libcore/ojluni/src/main/java/java/time/temporal/
H A DTemporalAdjusters.java18 * 2 along with this work; if not, write to the Free Software Foundation,
36 * Redistribution and use in source and binary forms, with or without
44 * and/or other materials provided with the distribution.
87 * The second is to use {@link Temporal#with(TemporalAdjuster)}:
91 * temporal = temporal.with(thisAdjuster);
93 * It is recommended to use the second approach, {@code with(TemporalAdjuster)},
144 return temporal.with(output);
157 * The behavior is suitable for use with most calendar systems.
160 * temporal.with(DAY_OF_MONTH, 1);
166 return (temporal) -> temporal.with(DAY_OF_MONT
[all...]
H A DTemporal.java18 * 2 along with this work; if not, write to the Free Software Foundation,
36 * Redistribution and use in source and binary forms, with or without
44 * and/or other materials provided with the distribution.
77 * These are modeled using {@code TemporalField} with the number held using
155 * Returns an adjusted object of the same type as this object with the adjustment made.
168 * date = date.with(Month.JULY); // most key classes implement TemporalAdjuster
169 * date = date.with(lastDayOfMonth()); // static import from Adjusters
170 * date = date.with(next(WEDNESDAY)); // static import from Adjusters and DayOfWeek
185 * @return an object of the same type with the specified adjustment made, not null
189 default Temporal with(TemporalAdjuste method in interface:Temporal
225 Temporal with(TemporalField field, long newValue); method in interface:Temporal
[all...]
/libcore/ojluni/src/main/java/java/time/
H A DOffsetTime.java18 * 2 along with this work; if not, write to the Free Software Foundation,
36 * Redistribution and use in source and binary forms, with or without
44 * and/or other materials provided with the distribution.
97 * A time with an offset from UTC/Greenwich in the ISO-8601 calendar system,
213 * This creates an offset time with the four specified fields.
237 * This creates an offset time with the same instant as that specified.
339 * @param time the time to create with, not null
340 * @param offset the zone offset to create with, not null
342 private OffsetTime with(LocalTime time, ZoneOffset offset) { method in class:OffsetTime
355 * {@link #get(TemporalField) get} and {@link #with(TemporalFiel
673 public OffsetTime with(TemporalAdjuster adjuster) { method in class:OffsetTime
721 public OffsetTime with(TemporalField field, long newValue) { method in class:OffsetTime
[all...]
H A DOffsetDateTime.java18 * 2 along with this work; if not, write to the Free Software Foundation,
36 * Redistribution and use in source and binary forms, with or without
44 * and/or other materials provided with the distribution.
98 * A date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system,
101 * {@code OffsetDateTime} is an immutable representation of a date-time with an offset.
248 * This creates an offset date-time with the specified local date, time and offset.
263 * This creates an offset date-time with the specified local date-time and offset.
277 * This creates an offset date-time with the seven specified fields.
308 * This creates an offset date-time with the same instant as that specified.
336 * The result will be the combination of {@code ZoneOffset} with eithe
417 private OffsetDateTime with(LocalDateTime dateTime, ZoneOffset offset) { method in class:OffsetDateTime
902 public OffsetDateTime with(TemporalAdjuster adjuster) { method in class:OffsetDateTime
961 public OffsetDateTime with(TemporalField field, long newValue) { method in class:OffsetDateTime
[all...]
H A DLocalDateTime.java18 * 2 along with this work; if not, write to the Free Software Foundation,
36 * Redistribution and use in source and binary forms, with or without
44 * and/or other materials provided with the distribution.
112 * Instead, it is a description of the date, as used for birthdays, combined with
215 * This returns a {@code LocalDateTime} with the specified year, month,
239 * This returns a {@code LocalDateTime} with the specified year, month,
264 * This returns a {@code LocalDateTime} with the specified year, month,
290 * This returns a {@code LocalDateTime} with the specified year, month,
314 * This returns a {@code LocalDateTime} with the specified year, month,
339 * This returns a {@code LocalDateTime} with th
509 private LocalDateTime with(LocalDate newDate, LocalTime newTime) { method in class:LocalDateTime
911 public LocalDateTime with(TemporalAdjuster adjuster) { method in class:LocalDateTime
958 public LocalDateTime with(TemporalField field, long newValue) { method in class:LocalDateTime
[all...]
H A DYearMonth.java18 * 2 along with this work; if not, write to the Free Software Foundation,
36 * Redistribution and use in source and binary forms, with or without
44 * and/or other materials provided with the distribution.
305 * Returns a copy of this year-month with the new year and month, checking
312 private YearMonth with(int newYear, int newMonth) { method in class:YearMonth
325 * {@link #get(TemporalField) get} and {@link #with(TemporalField, long)}
547 * remainder. However, years divisible by 100, are not leap years, with
603 * This returns a {@code YearMonth}, based on this one, with the year-month adjusted.
618 * @return a {@code YearMonth} based on {@code this} with the adjustment made, not null
623 public YearMonth with(TemporalAdjuste method in class:YearMonth
676 public YearMonth with(TemporalField field, long newValue) { method in class:YearMonth
[all...]
H A DMonthDay.java18 * 2 along with this work; if not, write to the Free Software Foundation,
36 * Redistribution and use in source and binary forms, with or without
44 * and/or other materials provided with the distribution.
441 // alignedDOW and alignedWOM not supported because they cannot be set in with()
508 * Returns a copy of this {@code MonthDay} with the month-of-year altered.
510 * This returns a month-day with the specified month.
517 * @return a {@code MonthDay} based on this month-day with the requested month, not null
521 return with(Month.of(month));
525 * Returns a copy of this {@code MonthDay} with the month-of-year altered.
527 * This returns a month-day with th
536 public MonthDay with(Month month) { method in class:MonthDay
[all...]
/libcore/ojluni/src/main/java/java/time/chrono/
H A DMinguoDate.java18 * 2 along with this work; if not, write to the Free Software Foundation,
31 * Redistribution and use in source and binary forms, with or without
39 * and/or other materials provided with the distribution.
165 * This returns a {@code MinguoDate} with the specified fields.
305 public MinguoDate with(TemporalField field, long newValue) { method in class:MinguoDate
321 return with(isoDate.withYear(getProlepticYear() >= 1 ? nvalue + YEARS_DIFFERENCE : (1 - nvalue) + YEARS_DIFFERENCE));
323 return with(isoDate.withYear(nvalue + YEARS_DIFFERENCE));
325 return with(isoDate.withYear((1 - getProlepticYear()) + YEARS_DIFFERENCE));
329 return with(isoDate.with(fiel
340 public MinguoDate with(TemporalAdjuster adjuster) { method in class:MinguoDate
415 private MinguoDate with(LocalDate newDate) { method in class:MinguoDate
[all...]
H A DThaiBuddhistDate.java18 * 2 along with this work; if not, write to the Free Software Foundation,
31 * Redistribution and use in source and binary forms, with or without
39 * and/or other materials provided with the distribution.
165 * This returns a {@code ThaiBuddhistDate} with the specified fields.
305 public ThaiBuddhistDate with(TemporalField field, long newValue) { method in class:ThaiBuddhistDate
321 return with(isoDate.withYear((getProlepticYear() >= 1 ? nvalue : 1 - nvalue) - YEARS_DIFFERENCE));
323 return with(isoDate.withYear(nvalue - YEARS_DIFFERENCE));
325 return with(isoDate.withYear((1 - getProlepticYear()) - YEARS_DIFFERENCE));
329 return with(isoDate.with(fiel
340 public ThaiBuddhistDate with(TemporalAdjuster adjuster) { method in class:ThaiBuddhistDate
415 private ThaiBuddhistDate with(LocalDate newDate) { method in class:ThaiBuddhistDate
[all...]
H A DChronoLocalDateTimeImpl.java18 * 2 along with this work; if not, write to the Free Software Foundation,
36 * Redistribution and use in source and binary forms, with or without
44 * and/or other materials provided with the distribution.
210 * Returns a copy of this date-time with the new date and time, checking
217 private ChronoLocalDateTimeImpl<D> with(Temporal newDate, LocalTime newTime) { method in class:ChronoLocalDateTimeImpl
277 public ChronoLocalDateTimeImpl<D> with(TemporalAdjuster adjuster) { method in class:ChronoLocalDateTimeImpl
279 // The Chronology is checked in with(date,time)
280 return with((ChronoLocalDate) adjuster, time);
282 return with(date, (LocalTime) adjuster);
290 public ChronoLocalDateTimeImpl<D> with(TemporalFiel method in class:ChronoLocalDateTimeImpl
[all...]
H A DJapaneseDate.java18 * 2 along with this work; if not, write to the Free Software Foundation,
31 * Redistribution and use in source and binary forms, with or without
39 * and/or other materials provided with the distribution.
105 * Japan introduced the Gregorian calendar starting with Meiji 6.
198 * This returns a {@code JapaneseDate} with the specified fields.
235 * This returns a {@code JapaneseDate} with the specified fields.
256 * This returns a {@code JapaneseDate} with the specified fields.
335 * and {@code era} and {@code year} must agree with {@code isoDate}.
515 public JapaneseDate with(TemporalField field, long newValue) { method in class:JapaneseDate
530 return with(isoDat
549 public JapaneseDate with(TemporalAdjuster adjuster) { method in class:JapaneseDate
660 private JapaneseDate with(LocalDate newDate) { method in class:JapaneseDate
[all...]
H A DChronoLocalDateImpl.java18 * 2 along with this work; if not, write to the Free Software Foundation,
31 * Redistribution and use in source and binary forms, with or without
39 * and/or other materials provided with the distribution.
87 * Note that not all calendar systems are suitable for use with this class.
93 * at the user interface level to deal with localized input/output.
116 * ChronoLocalDate first = now1.with(ChronoField.DAY_OF_MONTH, 1)
117 * .with(ChronoField.MONTH_OF_YEAR, 1);
136 * This abstract class must be implemented with care to ensure other classes operate correctly.
178 public D with(TemporalAdjuster adjuster) { method in class:ChronoLocalDateImpl
179 return (D) ChronoLocalDate.super.with(adjuste
184 public D with(TemporalField field, long value) { method in class:ChronoLocalDateImpl
[all...]
H A DChronoLocalDateTime.java18 * 2 along with this work; if not, write to the Free Software Foundation,
36 * Redistribution and use in source and binary forms, with or without
44 * and/or other materials provided with the distribution.
106 * interface, even in the case where the application needs to deal with multiple
113 * This interface must be implemented with care to ensure other classes operate correctly.
152 * {@link Chronology#localDateTime(TemporalAccessor)} with the extracted chronology.
192 * This returns a local date with the same year, month and day
202 * This returns a local time with the same hour, minute, second and
214 * {@link #get(TemporalField) get} and {@link #with(TemporalField, long)}
265 default ChronoLocalDateTime<D> with(TemporalAdjuste method in interface:ChronoLocalDateTime
275 ChronoLocalDateTime<D> with(TemporalField field, long newValue); method in interface:ChronoLocalDateTime
[all...]
H A DChronoLocalDate.java18 * 2 along with this work; if not, write to the Free Software Foundation,
36 * Redistribution and use in source and binary forms, with or without
44 * and/or other materials provided with the distribution.
103 * interface, even in the case where the application needs to deal with multiple
121 * to code that is intended to deal with any arbitrary calendar system.
149 * calendar systems increases the complications of interacting with persistence.
179 * where the year-of-era restarts with the reign of every new Emperor.
199 * and confines it to the UI layer. This approach is in keeping with other localization
231 * This interface must be implemented with care to ensure other classes operate correctly.
272 * {@link Chronology#date(TemporalAccessor)} with th
424 default ChronoLocalDate with(TemporalAdjuster adjuster) { method in interface:ChronoLocalDate
435 default ChronoLocalDate with(TemporalField field, long newValue) { method in interface:ChronoLocalDate
[all...]
/libcore/ojluni/src/test/java/time/test/java/time/
H A DTestLocalDateTime.java16 * 2 along with this work; if not, write to the Free Software Foundation,
34 * Redistribution and use in source and binary forms, with or without
42 * and/or other materials provided with the distribution.
158 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(1, 0)).withHour(0);
164 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(1, 0)).withHour(12);
176 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(0, 1)).withMinute(0);
182 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(12, 1)).withMinute(0);
194 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(0, 0, 1)).withSecond(0);
200 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(12, 0, 1)).withSecond(0);
212 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTim
[all...]
/libcore/ojluni/src/test/java/time/test/java/time/chrono/
H A DTestUmmAlQuraChronology.java18 * 2 along with this work; if not, write to the Free Software Foundation,
217 maxDate = maxDate.with(DAY_OF_MONTH, monthLen);
246 // HijrahDate.with(DAY_OF_YEAR, n)
262 HijrahDate hd2 = hd.with(DAY_OF_YEAR, i);
264 assertEquals(doy, i, "with(DAY_OF_YEAR) incorrect for " + i + " " + hd2);
271 HijrahDate hd2 = hd.with(DAY_OF_YEAR, 0);
277 HijrahDate hd2 = hd.with(DAY_OF_YEAR, hd.lengthOfYear() + 1);
280 // Test to verify the with() method with ChronoField is set to DAY_OF_WEEK
283 assertEquals(HijrahChronology.INSTANCE.date(1320, 1, 15).with(ChronoFiel
[all...]
H A DTestExampleCode.java18 * 2 along with this work; if not, write to the Free Software Foundation,
31 * Redistribution and use in source and binary forms, with or without
39 * and/or other materials provided with the distribution.
106 .with(ChronoField.DAY_OF_MONTH, 1)
107 .with(ChronoField.MONTH_OF_YEAR, 1);
159 .with(ChronoField.DAY_OF_MONTH, 1)
160 .with(ChronoField.MONTH_OF_YEAR, 1);
/libcore/
H A DAndroid.mk5 # you may not use this file except in compliance with the License.
19 # Subprojects with separate makefiles
H A DDocs.mk22 # Get list of targets annotated with annotations from jaif file
23 # Remove un-annotated original source file and replace them with annotated targets
/libcore/ojluni/src/test/java/time/tck/java/time/
H A DTestIsoChronology.java16 * 2 along with this work; if not, write to the Free Software Foundation,
34 * Redistribution and use in source and binary forms, with or without
42 * and/or other materials provided with the distribution.
206 // with(DateTimeAdjuster)
211 LocalDate test = base.with(TemporalAdjusters.lastDayOfMonth());
218 LocalDate test = base.with(TemporalAdjusters.lastDayOfMonth());
223 // ISODate.with(Local*)
228 LocalDate test = isoDate.with(LocalDate.of(2012, 7, 6));
235 assertEquals(IsoChronology.INSTANCE.date(1726, 4, 4), isoDate.with(Month.APRIL));
239 // LocalDate.with(ISODat
[all...]
/libcore/metrictests/
H A DAndroid.mk4 # you may not use this file except in compliance with the License.
/libcore/metrictests/memory/
H A DAndroid.mk4 # you may not use this file except in compliance with the License.
/libcore/ojluni/
H A DAndroid.mk5 # you may not use this file except in compliance with the License.
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/
H A DTCKWeekFields.java18 * 2 along with this work; if not, write to the Free Software Foundation,
31 * Redistribution and use in source and binary forms, with or without
39 * and/or other materials provided with the distribution.
140 assertEquals(date.with(WeekFields.ISO.dayOfWeek(), 2), LocalDate.of(2000, 1, 11));
141 assertEquals(date.with(WeekFields.ISO.dayOfWeek(), 7), LocalDate.of(2000, 1, 16));
143 assertEquals(date.with(WeekFields.SUNDAY_START.dayOfWeek(), 3), LocalDate.of(2000, 1, 11));
144 assertEquals(date.with(WeekFields.SUNDAY_START.dayOfWeek(), 7), LocalDate.of(2000, 1, 15));
146 assertEquals(date.with(WeekFields.of(DayOfWeek.SATURDAY, 1).dayOfWeek(), 4), LocalDate.of(2000, 1, 11));
147 assertEquals(date.with(WeekFields.of(DayOfWeek.TUESDAY, 1).dayOfWeek(), 1), LocalDate.of(2000, 1, 4));
180 // week of the 1st is partial; start with firs
[all...]

Completed in 675 milliseconds

1234