/libcore/ojluni/src/test/java/time/test/java/time/ |
D | TestDuration.java | 66 import java.time.Duration; 79 assertImmutable(Duration.class); in test_immutable() 84 Duration t = Duration.ofSeconds(-1); in plus_zeroReturnsThis() 85 assertSame(t.plus(Duration.ZERO), t); in plus_zeroReturnsThis() 90 Duration t = Duration.ofSeconds(-1); in plus_zeroSingleton() 91 assertSame(t.plus(Duration.ofSeconds(1)), Duration.ZERO); in plus_zeroSingleton() 96 Duration t = Duration.ofSeconds(-1); in plusSeconds_zeroReturnsThis() 102 Duration t = Duration.ofSeconds(-1); in plusSeconds_zeroSingleton() 103 assertSame(t.plusSeconds(1), Duration.ZERO); in plusSeconds_zeroSingleton() 108 Duration t = Duration.ofSeconds(-1, 2000000); in plusMillis_zeroReturnsThis() [all …]
|
D | TestClock_Offset.java | 66 import java.time.Duration; 78 private static final Duration OFFSET = Duration.ofSeconds(2);
|
D | TestClock_Tick.java | 66 import java.time.Duration; 86 Clock test = Clock.tick(Clock.system(PARIS), Duration.ofMillis(500)); in test_withZone_same() 93 Clock test = Clock.tick(Clock.systemUTC(), Duration.ofMillis(500)); in test_toString()
|
/libcore/ojluni/src/test/java/time/tck/java/time/ |
D | TCKDuration.java | 78 import java.time.Duration; 112 assertEquals(Duration.ZERO.getSeconds(), 0L); in test_zero() 113 assertEquals(Duration.ZERO.getNano(), 0); in test_zero() 122 Duration t = Duration.ofSeconds(i); in factory_seconds_long() 135 Duration t = Duration.ofSeconds(i, j); in factory_seconds_long_long() 140 Duration t = Duration.ofSeconds(i, j); in factory_seconds_long_long() 145 Duration t = Duration.ofSeconds(i, j); in factory_seconds_long_long() 154 Duration test = Duration.ofSeconds(2L, -1); in factory_seconds_long_long_nanosNegativeAdjusted() 161 Duration.ofSeconds(Long.MAX_VALUE, 1000000000); in factory_seconds_long_long_tooBig() 186 Duration test = Duration.ofMillis(millis); in factory_millis_long() [all …]
|
D | TCKClock_Tick.java | 66 import java.time.Duration; 88 …t = Clock.tick(Clock.fixed(ZDT.withNano(i * 1000_000).toInstant(), PARIS), Duration.ofMillis(250)); in test_tick_ClockDuration_250millis() 96 …st = Clock.tick(Clock.fixed(ZDT.withNano(i * 1000).toInstant(), PARIS), Duration.ofNanos(250_000)); in test_tick_ClockDuration_250micros() 104 … Clock test = Clock.tick(Clock.fixed(ZDT.withNano(i).toInstant(), PARIS), Duration.ofNanos(20)); in test_tick_ClockDuration_20nanos() 112 Clock test = Clock.tick(underlying, Duration.ZERO); in test_tick_ClockDuration_zeroDuration() 118 Clock test = Clock.tick(underlying, Duration.ofNanos(1)); in test_tick_ClockDuration_1nsDuration() 124 Clock.tick(Clock.systemUTC(), Duration.ofSeconds(Long.MAX_VALUE)); in test_tick_ClockDuration_maxDuration() 129 Clock.tick(Clock.systemUTC(), Duration.ofSeconds(0, 123)); in test_tick_ClockDuration_subMilliNotDivisible_123ns() 134 Clock.tick(Clock.systemUTC(), Duration.ofSeconds(0, 999)); in test_tick_ClockDuration_subMilliNotDivisible_999ns() 139 Clock.tick(Clock.systemUTC(), Duration.ofSeconds(0, 999_999_999)); in test_tick_ClockDuration_subMilliNotDivisible_999_999_999ns() [all …]
|
D | TCKClock_Offset.java | 66 import java.time.Duration; 83 private static final Duration OFFSET = Duration.ofSeconds(2); 96 Clock test = Clock.offset(underlying, Duration.ZERO); in test_offset_ClockDuration_zeroDuration() 102 Clock.offset(null, Duration.ZERO); in test_offset_ClockDuration_nullClock()
|
/libcore/ojluni/src/main/java/java/time/temporal/ |
D | ChronoUnit.java | 59 import java.time.Duration; 83 NANOS("Nanos", Duration.ofNanos(1)), 88 MICROS("Micros", Duration.ofNanos(1000)), 93 MILLIS("Millis", Duration.ofNanos(1000_000)), 99 SECONDS("Seconds", Duration.ofSeconds(1)), 104 MINUTES("Minutes", Duration.ofSeconds(60)), 109 HOURS("Hours", Duration.ofSeconds(3600)), 114 HALF_DAYS("HalfDays", Duration.ofSeconds(43200)), 125 DAYS("Days", Duration.ofSeconds(86400)), 132 WEEKS("Weeks", Duration.ofSeconds(7 * 86400L)), [all …]
|
D | TemporalUnit.java | 65 import java.time.Duration; 113 Duration getDuration(); in getDuration()
|
D | IsoFields.java | 76 import java.time.Duration; 649 WEEK_BASED_YEARS("WeekBasedYears", Duration.ofSeconds(31556952L)), 653 QUARTER_YEARS("QuarterYears", Duration.ofSeconds(31556952L / 4)); 656 private final Duration duration; 658 private Unit(String name, Duration estimatedDuration) { in Unit() 664 public Duration getDuration() { in getDuration()
|
D | TemporalAmount.java | 65 import java.time.Duration;
|
/libcore/ojluni/annotations/hiddenapi/java/time/ |
D | Duration.java | 68 public final class Duration class 70 java.lang.Comparable<java.time.Duration>, 73 private Duration(long seconds, int nanos) { in Duration() method in Duration 77 public static java.time.Duration ofDays(long days) { in ofDays() 81 public static java.time.Duration ofHours(long hours) { in ofHours() 85 public static java.time.Duration ofMinutes(long minutes) { in ofMinutes() 89 public static java.time.Duration ofSeconds(long seconds) { in ofSeconds() 93 public static java.time.Duration ofSeconds(long seconds, long nanoAdjustment) { in ofSeconds() 97 public static java.time.Duration ofMillis(long millis) { in ofMillis() 101 public static java.time.Duration ofNanos(long nanos) { in ofNanos() [all …]
|
/libcore/luni/src/test/java/libcore/java/time/ |
D | DurationTest.java | 20 import java.time.Duration; 45 public static final Duration MAX_DURATION = Duration.ofSeconds(Long.MAX_VALUE, 999_999_999); 49 assertSame(Instant.EPOCH, Duration.ZERO.addTo(Instant.EPOCH)); in test_addTo() 54 Duration.between(Instant.EPOCH, Instant.MAX).addTo(Instant.EPOCH)); in test_addTo() 56 Duration.between(Instant.MIN, Instant.MAX).addTo(Instant.MIN)); in test_addTo() 58 Duration.between(Instant.MIN, Instant.EPOCH).addTo(Instant.MIN)); in test_addTo() 63 assertSame(Instant.EPOCH, Duration.ZERO.subtractFrom(Instant.EPOCH)); in test_subtractFrom() 65 Duration.between(Instant.MIN, Instant.EPOCH).subtractFrom(Instant.EPOCH)); in test_subtractFrom() 67 Duration.between(Instant.MIN, Instant.MAX).subtractFrom(Instant.MAX)); in test_subtractFrom() 69 Duration.between(Instant.EPOCH, Instant.MAX).subtractFrom(Instant.MAX)); in test_subtractFrom() [all …]
|
/libcore/ojluni/src/main/java/java/time/ |
D | Duration.java | 127 public final class Duration class 128 implements TemporalAmount, Comparable<Duration>, Serializable { 133 public static final Duration ZERO = new Duration(0, 0); 172 public static Duration ofDays(long days) { in ofDays() 187 public static Duration ofHours(long hours) { in ofHours() 202 public static Duration ofMinutes(long minutes) { in ofMinutes() 215 public static Duration ofSeconds(long seconds) { in ofSeconds() 238 public static Duration ofSeconds(long seconds, long nanoAdjustment) { in ofSeconds() 253 public static Duration ofMillis(long millis) { in ofMillis() 272 public static Duration ofNanos(long nanos) { in ofNanos() [all …]
|
D | Clock.java | 279 public static Clock tick(Clock baseClock, Duration tickDuration) { in tick() 340 public static Clock offset(Clock baseClock, Duration offsetDuration) { in offset() 343 if (offsetDuration.equals(Duration.ZERO)) { in offset() 548 private final Duration offset; 550 OffsetClock(Clock baseClock, Duration offset) { in OffsetClock() 645 return "TickClock[" + baseClock + "," + Duration.ofNanos(tickNanos) + "]"; in toString()
|
D | Ser.java | 169 ((Duration) object).writeExternal(out); in writeInternal() 256 case DURATION_TYPE: return Duration.readExternal(in); in readInternal()
|
/libcore/ojluni/src/test/java/time/tck/java/time/serial/ |
D | TCKDurationSerialization.java | 70 import java.time.Duration; 81 assertTrue(Serializable.class.isAssignableFrom(Duration.class)); in test_interfaces() 82 assertTrue(Comparable.class.isAssignableFrom(Duration.class)); in test_interfaces() 88 assertSerializable(Duration.ofHours(5)); in test_serialization() 89 assertSerializable(Duration.ofHours(0)); in test_serialization() 90 assertSerializable(Duration.ofHours(-5)); in test_serialization() 102 assertSerializedBySer(Duration.ofSeconds(654321, 123456789), bytes); in test_serialization_format() 110 assertSerializableSame(Duration.ZERO); in test_deserializationSingleton() 115 assertNotSerializable(Duration.class); in test_invalid_serialform()
|
D | TCKClockSerialization.java | 65 import java.time.Duration; 85 private static final Duration AMOUNT = Duration.ofSeconds(2);
|
/libcore/luni/src/main/java/javax/xml/datatype/ |
D | Duration.java | 93 public abstract class Duration { class 487 public abstract Duration add(final Duration rhs); in add() 613 public Duration subtract(final Duration rhs) { in subtract() 633 public Duration multiply(int factor) { in multiply() 684 public abstract Duration multiply(final BigDecimal factor); in multiply() 698 public abstract Duration negate(); in negate() 730 public abstract Duration normalizeWith(final Calendar startTimeInstant); in normalizeWith() 762 public abstract int compare(final Duration duration); in compare() 790 public boolean isLongerThan(final Duration duration) { in isLongerThan() 812 public boolean isShorterThan(final Duration duration) { in isShorterThan() [all …]
|
D | DatatypeFactory.java | 167 public abstract Duration newDuration(final String lexicalRepresentation); in newDuration() 204 public abstract Duration newDuration(final long durationInMilliSeconds); in newDuration() 231 public abstract Duration newDuration( in newDuration() 268 public Duration newDuration( in newDuration() 330 public Duration newDurationDayTime(final String lexicalRepresentation) { in newDurationDayTime() 383 public Duration newDurationDayTime(final long durationInMilliseconds) { in newDurationDayTime() 466 public Duration newDurationDayTime( in newDurationDayTime() 508 public Duration newDurationDayTime( in newDurationDayTime() 543 public Duration newDurationYearMonth(final String lexicalRepresentation) { in newDurationYearMonth() 592 public Duration newDurationYearMonth(final long durationInMilliseconds) { in newDurationYearMonth() [all …]
|
/libcore/ojluni/src/test/java/time/test/java/time/chrono/ |
D | TestChronologyPerf.java | 27 import java.time.Duration; 46 Duration d = Duration.of(end - start, ChronoUnit.NANOS); in test_chronologyGetAvailablePerf() 52 d = Duration.of(end - start, ChronoUnit.NANOS); in test_chronologyGetAvailablePerf() 58 d = Duration.of(end - start, ChronoUnit.NANOS); in test_chronologyGetAvailablePerf()
|
/libcore/ojluni/src/test/java/time/test/java/time/zone/ |
D | TestFixedZoneRules.java | 66 import java.time.Duration; 95 assertEquals(test.getDaylightSavings(null), Duration.ZERO); in test_data_nullInput()
|
/libcore/luni/src/test/java/libcore/java/time/zone/ |
D | ZoneRulesTest.java | 19 import java.time.Duration; 56 assertEquals(Duration.ZERO, zoneRules.getDaylightSavings(instant)); in test_of_ZoneOffset()
|
/libcore/ojluni/src/main/java/java/time/zone/ |
D | ZoneOffsetTransition.java | 70 import java.time.Duration; 321 public Duration getDuration() { in getDuration() 322 return Duration.ofSeconds(getDurationSeconds()); in getDuration()
|
/libcore/ojluni/src/test/java/time/tck/java/time/zone/ |
D | TCKFixedZoneRules.java | 68 import java.time.Duration; 156 assertEquals(test.getDaylightSavings(INSTANT), Duration.ZERO); in test_getDaylightSavings_Instant() 157 assertEquals(test.getDaylightSavings(null), Duration.ZERO); in test_getDaylightSavings_Instant()
|
D | TCKZoneOffsetTransition.java | 65 import java.time.Duration; 129 assertEquals(test.getDuration(), Duration.of(1, HOURS)); in test_getters_gap() 144 assertEquals(test.getDuration(), Duration.of(-1, HOURS)); in test_getters_overlap()
|