Searched refs:unit (Results 26 - 50 of 100) sorted by relevance

1234

/libcore/ojluni/src/main/java/java/time/
H A DOffsetTime.java397 * Checks if the specified unit is supported.
399 * This checks if the specified unit can be added to, or subtracted from, this offset-time.
403 * If the unit is a {@link ChronoUnit} then the query is implemented here.
416 * If the unit is not a {@code ChronoUnit}, then the result of this method
419 * Whether the unit is supported is determined by the unit.
421 * @param unit the unit to check, null returns false
422 * @return true if the unit can be added/subtracted, false if not
425 public boolean isSupported(TemporalUnit unit) { argument
816 truncatedTo(TemporalUnit unit) argument
872 plus(long amountToAdd, TemporalUnit unit) argument
986 minus(long amountToSubtract, TemporalUnit unit) argument
1171 until(Temporal endExclusive, TemporalUnit unit) argument
[all...]
H A DLocalTime.java519 * Checks if the specified unit is supported.
521 * This checks if the specified unit can be added to, or subtracted from, this time.
525 * If the unit is a {@link ChronoUnit} then the query is implemented here.
538 * If the unit is not a {@code ChronoUnit}, then the result of this method
541 * Whether the unit is supported is determined by the unit.
543 * @param unit the unit to check, null returns false
544 * @return true if the unit can be added/subtracted, false if not
547 public boolean isSupported(TemporalUnit unit) { argument
943 truncatedTo(TemporalUnit unit) argument
1038 plus(long amountToAdd, TemporalUnit unit) argument
1199 minus(long amountToSubtract, TemporalUnit unit) argument
1378 until(Temporal endExclusive, TemporalUnit unit) argument
[all...]
H A DDuration.java102 * In addition, the {@link ChronoUnit#DAYS DAYS} unit can be used and is treated as
284 * Obtains a {@code Duration} representing an amount in the specified unit.
292 * The unit must either have an {@linkplain TemporalUnit#isDurationEstimated() exact duration} or
295 * @param amount the amount of the duration, measured in terms of the unit, positive or negative
296 * @param unit the unit that the duration is measured in, must have an exact duration, not null
298 * @throws DateTimeException if the period unit has an estimated duration
301 public static Duration of(long amount, TemporalUnit unit) { argument
302 return ZERO.plus(amount, unit);
314 * the {@linkplain TemporalUnit#getDuration() duration} of the unit t
525 get(TemporalUnit unit) argument
689 plus(long amountToAdd, TemporalUnit unit) argument
850 minus(long amountToSubtract, TemporalUnit unit) argument
[all...]
H A DOffsetDateTime.java483 * Checks if the specified unit is supported.
485 * This checks if the specified unit can be added to, or subtracted from, this date-time.
489 * If the unit is a {@link ChronoUnit} then the query is implemented here.
510 * If the unit is not a {@code ChronoUnit}, then the result of this method
513 * Whether the unit is supported is determined by the unit.
515 * @param unit the unit to check, null returns false
516 * @return true if the unit can be added/subtracted, false if not
519 public boolean isSupported(TemporalUnit unit) { argument
1126 truncatedTo(TemporalUnit unit) argument
1182 plus(long amountToAdd, TemporalUnit unit) argument
1374 minus(long amountToSubtract, TemporalUnit unit) argument
1648 until(Temporal endExclusive, TemporalUnit unit) argument
[all...]
H A DPeriod.java267 for (TemporalUnit unit : amount.getUnits()) {
268 long unitAmount = amount.get(unit);
269 if (unit == ChronoUnit.YEARS) {
271 } else if (unit == ChronoUnit.MONTHS) {
273 } else if (unit == ChronoUnit.DAYS) {
276 throw new DateTimeException("Unit must be Years, Months or Days, but was " + unit);
413 * Gets the value of the requested unit.
420 * @param unit the {@code TemporalUnit} for which to return the value
421 * @return the long value of the unit
422 * @throws DateTimeException if the unit i
426 get(TemporalUnit unit) argument
[all...]
H A DLocalDateTime.java577 * Checks if the specified unit is supported.
579 * This checks if the specified unit can be added to, or subtracted from, this date-time.
583 * If the unit is a {@link ChronoUnit} then the query is implemented here.
604 * If the unit is not a {@code ChronoUnit}, then the result of this method
607 * Whether the unit is supported is determined by the unit.
609 * @param unit the unit to check, null returns false
610 * @return true if the unit can be added/subtracted, false if not
613 public boolean isSupported(TemporalUnit unit) { argument
1114 truncatedTo(TemporalUnit unit) argument
1176 plus(long amountToAdd, TemporalUnit unit) argument
1388 minus(long amountToSubtract, TemporalUnit unit) argument
1676 until(Temporal endExclusive, TemporalUnit unit) argument
[all...]
H A DZonedDateTime.java702 * Checks if the specified unit is supported.
704 * This checks if the specified unit can be added to, or subtracted from, this date-time.
708 * If the unit is a {@link ChronoUnit} then the query is implemented here.
729 * If the unit is not a {@code ChronoUnit}, then the result of this method
732 * Whether the unit is supported is determined by the unit.
734 * @param unit the unit to check, null returns false
735 * @return true if the unit can be added/subtracted, false if not
738 public boolean isSupported(TemporalUnit unit) { argument
1520 truncatedTo(TemporalUnit unit) argument
1593 plus(long amountToAdd, TemporalUnit unit) argument
1841 minus(long amountToSubtract, TemporalUnit unit) argument
2112 until(Temporal endExclusive, TemporalUnit unit) argument
[all...]
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/
H A DTCKChronoUnit.java123 public void test_unitType(ChronoUnit unit, boolean isDateBased, boolean isTimeBased, boolean isDurationEstimated) { argument
124 assertEquals(unit.isDateBased(), isDateBased);
125 assertEquals(unit.isTimeBased(), isTimeBased);
126 assertEquals(unit.isDurationEstimated(), isDurationEstimated);
169 public void test_unitAndTemporal(ChronoUnit unit, Temporal base, boolean isSupportedBy, long amount, Temporal target) { argument
170 assertEquals(unit.isSupportedBy(base), isSupportedBy);
172 Temporal result = unit.addTo(base, amount);
174 assertEquals(unit.between(base, result), amount);
183 for (ChronoUnit unit : ChronoUnit.values()) {
184 assertEquals(ChronoUnit.valueOf(unit
[all...]
/libcore/ojluni/src/main/java/java/util/concurrent/
H A DExecutors.java629 public boolean awaitTermination(long timeout, TimeUnit unit) argument
631 return e.awaitTermination(timeout, unit);
647 long timeout, TimeUnit unit)
649 return e.invokeAll(tasks, timeout, unit);
656 long timeout, TimeUnit unit)
658 return e.invokeAny(tasks, timeout, unit);
684 public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { argument
685 return e.schedule(command, delay, unit);
687 public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { argument
688 return e.schedule(callable, delay, unit);
646 invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) argument
655 invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) argument
690 scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) argument
693 scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) argument
[all...]
H A DSemaphore.java408 * @param unit the time unit of the {@code timeout} argument
413 public boolean tryAcquire(long timeout, TimeUnit unit) argument
415 return sync.tryAcquireSharedNanos(1, unit.toNanos(timeout));
583 * @param unit the time unit of the {@code timeout} argument
589 public boolean tryAcquire(int permits, long timeout, TimeUnit unit) argument
592 return sync.tryAcquireSharedNanos(permits, unit.toNanos(timeout));
H A DScheduledThreadPoolExecutor.java240 public long getDelay(TimeUnit unit) { argument
241 return unit.convert(time - System.nanoTime(), NANOSECONDS);
520 private long triggerTime(long delay, TimeUnit unit) { argument
521 return triggerTime(unit.toNanos((delay < 0) ? 0 : delay));
555 TimeUnit unit) {
556 if (command == null || unit == null)
560 triggerTime(delay, unit),
572 TimeUnit unit) {
573 if (callable == null || unit == null)
577 triggerTime(delay, unit),
553 schedule(Runnable command, long delay, TimeUnit unit) argument
570 schedule(Callable<V> callable, long delay, TimeUnit unit) argument
588 scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) argument
613 scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) argument
1080 offer(Runnable e, long timeout, TimeUnit unit) argument
1147 poll(long timeout, TimeUnit unit) argument
[all...]
H A DThreadPoolExecutor.java1204 * @param unit the time unit for the {@code keepAliveTime} argument
1218 TimeUnit unit,
1220 this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue,
1235 * @param unit the time unit for the {@code keepAliveTime} argument
1252 TimeUnit unit,
1255 this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue,
1270 * @param unit the time unit fo
1215 ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) argument
1249 ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory) argument
1284 ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler) argument
1321 ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler) argument
1477 awaitTermination(long timeout, TimeUnit unit) argument
1725 setKeepAliveTime(long time, TimeUnit unit) argument
1749 getKeepAliveTime(TimeUnit unit) argument
[all...]
/libcore/ojluni/src/test/java/nio/file/attribute/
H A DFileTimeTest.java116 for (TimeUnit unit: TimeUnit.values()) {
117 for (int i=0; i<100; i++) { to(rand.nextLong(), unit); }
118 to(Long.MIN_VALUE, unit);
119 to(Long.MAX_VALUE, unit);
124 for (TimeUnit unit : EnumSet.allOf(TimeUnit.class)) {
127 FileTime ft = FileTime.from(value, unit);
130 eqTime(value, unit, instant);
134 for (TimeUnit unit : EnumSet.allOf(TimeUnit.class)) {
136 FileTime ft = FileTime.from(value, unit);
138 if (unit
295 eqTime(long value, TimeUnit unit, Instant instant) argument
322 to(long v, TimeUnit unit) argument
333 ts(long v, TimeUnit unit, String expected) argument
[all...]
/libcore/ojluni/src/main/java/java/nio/channels/
H A DAsynchronousSocketChannel.java385 * @param unit
386 * The time unit of the {@code timeout} argument
403 TimeUnit unit,
490 * @param unit
491 * The time unit of the {@code timeout} argument
513 TimeUnit unit,
544 * @param unit
545 * The time unit of the {@code timeout} argument
560 TimeUnit unit,
643 * @param unit
401 read(ByteBuffer dst, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler) argument
509 read(ByteBuffer[] dsts, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long,? super A> handler) argument
558 write(ByteBuffer src, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler) argument
660 write(ByteBuffer[] srcs, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long,? super A> handler) argument
[all...]
H A DAsynchronousChannelGroup.java332 * @param unit
333 * The time unit of the timeout argument
341 public abstract boolean awaitTermination(long timeout, TimeUnit unit) argument
/libcore/ojluni/src/main/java/java/time/chrono/
H A DChronoLocalDateTime.java232 * Checks if the specified unit is supported.
234 * This checks if the specified unit can be added to or subtracted from this date-time.
241 * If the unit is not a {@code ChronoUnit}, then the result of this method
244 * Whether the unit is supported is determined by the unit.
246 * @param unit the unit to check, null returns false
247 * @return true if the unit can be added/subtracted, false if not
250 default boolean isSupported(TemporalUnit unit) { argument
251 if (unit instanceo
293 plus(long amountToAdd, TemporalUnit unit) argument
311 minus(long amountToSubtract, TemporalUnit unit) argument
[all...]
H A DChronoZonedDateTime.java379 * Checks if the specified unit is supported.
381 * This checks if the specified unit can be added to or subtracted from this date-time.
388 * If the unit is not a {@code ChronoUnit}, then the result of this method
391 * Whether the unit is supported is determined by the unit.
393 * @param unit the unit to check, null returns false
394 * @return true if the unit can be added/subtracted, false if not
397 default boolean isSupported(TemporalUnit unit) { argument
398 if (unit instanceo
440 plus(long amountToAdd, TemporalUnit unit) argument
458 minus(long amountToSubtract, TemporalUnit unit) argument
[all...]
H A DChronoLocalDateTimeImpl.java304 public ChronoLocalDateTimeImpl<D> plus(long amountToAdd, TemporalUnit unit) { argument
305 if (unit instanceof ChronoUnit) {
306 ChronoUnit f = (ChronoUnit) unit;
316 return with(date.plus(amountToAdd, unit), time);
318 return ChronoLocalDateTimeImpl.ensureValid(date.getChronology(), unit.addTo(this, amountToAdd));
371 public long until(Temporal endExclusive, TemporalUnit unit) { argument
375 if (unit instanceof ChronoUnit) {
376 if (unit.isTimeBased()) {
378 switch ((ChronoUnit) unit) {
387 return Math.addExact(amount, time.until(end.toLocalTime(), unit));
[all...]
H A DChronoZonedDateTimeImpl.java301 public ChronoZonedDateTime<D> plus(long amountToAdd, TemporalUnit unit) { argument
302 if (unit instanceof ChronoUnit) {
303 return with(dateTime.plus(amountToAdd, unit));
305 return ChronoZonedDateTimeImpl.ensureValid(getChronology(), unit.addTo(this, amountToAdd)); /// TODO: Generics replacement Risk!
310 public long until(Temporal endExclusive, TemporalUnit unit) { argument
314 if (unit instanceof ChronoUnit) {
316 return dateTime.until(end.toLocalDateTime(), unit);
318 Objects.requireNonNull(unit, "unit");
319 return unit
[all...]
/libcore/ojluni/src/main/java/sun/nio/ch/
H A DCompletedFuture.java74 public V get(long timeout, TimeUnit unit) throws ExecutionException { argument
75 if (unit == null)
H A DAsynchronousSocketChannelImpl.java219 TimeUnit unit,
228 TimeUnit unit,
276 return implRead(isScatteringRead, dst, dsts, timeout, unit, att, handler);
289 TimeUnit unit,
297 read(false, dst, null, timeout, unit, attachment, handler);
305 TimeUnit unit,
318 read(true, null, bufs, timeout, unit, attachment, handler);
328 TimeUnit unit,
337 TimeUnit unit,
382 return implWrite(isGatheringWrite, src, srcs, timeout, unit, at
215 implRead(boolean isScatteringRead, ByteBuffer dst, ByteBuffer[] dsts, long timeout, TimeUnit unit, A attachment, CompletionHandler<V,? super A> handler) argument
224 read(boolean isScatteringRead, ByteBuffer dst, ByteBuffer[] dsts, long timeout, TimeUnit unit, A att, CompletionHandler<V,? super A> handler) argument
287 read(ByteBuffer dst, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler) argument
301 read(ByteBuffer[] dsts, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long,? super A> handler) argument
324 implWrite(boolean isGatheringWrite, ByteBuffer src, ByteBuffer[] srcs, long timeout, TimeUnit unit, A attachment, CompletionHandler<V,? super A> handler) argument
333 write(boolean isGatheringWrite, ByteBuffer src, ByteBuffer[] srcs, long timeout, TimeUnit unit, A att, CompletionHandler<V,? super A> handler) argument
391 write(ByteBuffer src, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler) argument
403 write(ByteBuffer[] srcs, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long,? super A> handler) argument
[all...]
/libcore/ojluni/src/main/java/sun/nio/fs/
H A DAbstractWatchService.java104 public final WatchKey poll(long timeout, TimeUnit unit) argument
108 WatchKey key = pendingKeys.poll(timeout, unit);
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/
H A DCopticDate.java259 public CopticDate plus(long amountToAdd, TemporalUnit unit) { argument
260 if (unit instanceof ChronoUnit) {
261 ChronoUnit f = (ChronoUnit) unit;
271 throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);
273 return unit.addTo(this, amountToAdd);
300 public long until(Temporal endExclusive, TemporalUnit unit) { argument
302 if (unit instanceof ChronoUnit) {
303 return LocalDate.from(this).until(end, unit); // TODO: this is wrong
305 return unit
[all...]
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/serial/
H A DTCKChronoUnitSerialization.java118 public void test_unitType(ChronoUnit unit) throws IOException, ClassNotFoundException { argument
119 assertSerializableSame(unit);
/libcore/luni/src/main/java/libcore/icu/
H A DRelativeDateTimeFormatter.java71 * In the implementation below, it selects the appropriate time unit based on
75 * minResolution is HOUR_IN_MILLIS. Once getting the quantity and unit to
139 android.icu.text.RelativeDateTimeFormatter.RelativeUnit unit;
144 unit = android.icu.text.RelativeDateTimeFormatter.RelativeUnit.SECONDS;
147 unit = android.icu.text.RelativeDateTimeFormatter.RelativeUnit.MINUTES;
153 unit = android.icu.text.RelativeDateTimeFormatter.RelativeUnit.HOURS;
156 unit = android.icu.text.RelativeDateTimeFormatter.RelativeUnit.DAYS;
160 // available. Note that we cannot set up direction and unit here and
197 unit = android.icu.text.RelativeDateTimeFormatter.RelativeUnit.WEEKS;
224 return formatter.format(count, direction, unit);
[all...]

Completed in 449 milliseconds

1234