Searched refs:unit (Results 1 - 25 of 100) sorted by relevance

1234

/libcore/ojluni/src/test/java/time/tck/java/time/
H A DMockSimplePeriod.java74 * Mock period of time measured using a single unit, such as {@code 3 Days}.
93 * The unit the period is measured in.
95 private final TemporalUnit unit; field in class:MockSimplePeriod
98 * Obtains a {@code MockSimplePeriod} from an amount and unit.
102 * @param amount the amount of the period, measured in terms of the unit, positive or negative
103 * @param unit the unit that the period is measured in, must not be the 'Forever' unit, not null
105 * @throws java.time.DateTimeException if the period unit is {@link java.time.temporal.ChronoUnit#FOREVER}.
107 public static MockSimplePeriod of(long amount, TemporalUnit unit) { argument
111 MockSimplePeriod(long amount, TemporalUnit unit) argument
121 get(TemporalUnit unit) argument
[all...]
/libcore/ojluni/src/test/java/time/test/java/time/
H A DMockSimplePeriod.java74 * Mock period of time measured using a single unit, such as {@code 3 Days}.
93 * The unit the period is measured in.
95 private final TemporalUnit unit; field in class:MockSimplePeriod
98 * Obtains a {@code MockSimplePeriod} from an amount and unit.
102 * @param amount the amount of the period, measured in terms of the unit, positive or negative
103 * @param unit the unit that the period is measured in, must not be the 'Forever' unit, not null
105 * @throws DateTimeException if the period unit is {@link java.time.temporal.ChronoUnit#FOREVER}.
107 public static MockSimplePeriod of(long amount, TemporalUnit unit) { argument
111 MockSimplePeriod(long amount, TemporalUnit unit) argument
121 get(TemporalUnit unit) argument
[all...]
/libcore/ojluni/src/main/java/java/util/concurrent/
H A DDelayed.java53 * given time unit.
55 * @param unit the time unit
59 long getDelay(TimeUnit unit); argument
H A DScheduledExecutorService.java102 * @param unit the time unit of the delay parameter
111 long delay, TimeUnit unit);
119 * @param unit the time unit of the delay parameter
127 long delay, TimeUnit unit);
157 * @param unit the time unit of the initialDelay and period parameters
171 TimeUnit unit);
197 * @param unit th
110 schedule(Runnable command, long delay, TimeUnit unit) argument
126 schedule(Callable<V> callable, long delay, TimeUnit unit) argument
168 scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) argument
208 scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) argument
[all...]
H A DBlockingDeque.java77 * <td>{@link #offerFirst(Object, long, TimeUnit) offerFirst(e, time, unit)}</td>
84 * <td>{@link #pollFirst(long, TimeUnit) pollFirst(time, unit)}</td>
108 * <td>{@link #offerLast(Object, long, TimeUnit) offerLast(e, time, unit)}</td>
115 * <td>{@link #pollLast(long, TimeUnit) pollLast(time, unit)}</td>
157 * <td>{@link #offer(Object, long, TimeUnit) offer(e, time, unit)}</td>
158 * <td>{@link #offerLast(Object, long, TimeUnit) offerLast(e, time, unit)}</td>
176 * <td>{@link #poll(long, TimeUnit) poll(time, unit)}</td>
177 * <td>{@link #pollFirst(long, TimeUnit) pollFirst(time, unit)}</td>
312 * {@code unit}
313 * @param unit
324 offerFirst(E e, long timeout, TimeUnit unit) argument
346 offerLast(E e, long timeout, TimeUnit unit) argument
380 pollFirst(long timeout, TimeUnit unit) argument
396 pollLast(long timeout, TimeUnit unit) argument
513 offer(E e, long timeout, TimeUnit unit) argument
564 poll(long timeout, TimeUnit unit) argument
[all...]
H A DBlockingQueue.java75 * <td>{@link #offer(Object, long, TimeUnit) offer(e, time, unit)}</td>
82 * <td>{@link #poll(long, TimeUnit) poll(time, unit)}</td>
241 * {@code unit}
242 * @param unit a {@code TimeUnit} determining how to interpret the
253 boolean offer(E e, long timeout, TimeUnit unit) argument
270 * {@code unit}
271 * @param unit a {@code TimeUnit} determining how to interpret the
277 E poll(long timeout, TimeUnit unit) argument
H A DCompletionService.java115 * {@code unit}
116 * @param unit a {@code TimeUnit} determining how to interpret the
123 Future<V> poll(long timeout, TimeUnit unit) throws InterruptedException; argument
H A DFuture.java159 * @param unit the time unit of the timeout argument
168 V get(long timeout, TimeUnit unit) argument
H A DTransferQueue.java120 * {@code unit}
121 * @param unit a {@code TimeUnit} determining how to interpret the
134 boolean tryTransfer(E e, long timeout, TimeUnit unit) argument
H A DCountDownLatch.java270 * @param unit the time unit of the {@code timeout} argument
276 public boolean await(long timeout, TimeUnit unit) argument
278 return sync.tryAcquireSharedNanos(1, unit.toNanos(timeout));
H A DExecutorService.java195 * @param unit the time unit of the timeout argument
200 boolean awaitTermination(long timeout, TimeUnit unit) argument
294 * @param unit the time unit of the timeout argument
304 * unit are {@code null}
309 long timeout, TimeUnit unit)
345 * @param unit the time unit of the timeout argument
349 * @throws NullPointerException if tasks, or unit, o
308 invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) argument
357 invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) argument
[all...]
/libcore/ojluni/src/main/java/java/time/temporal/
H A DTemporal.java132 * Checks if the specified unit is supported.
134 * This checks if the specified unit can be added to, or subtracted from, this date-time.
140 * If the unit is supported, then true must be returned, otherwise false must be returned.
149 * @param unit the unit to check, null returns false
150 * @return true if the unit can be added/subtracted, false if not
152 boolean isSupported(TemporalUnit unit); argument
279 * If the unit is supported, then the addition must be performed.
282 * If the unit is not a {@code ChronoUnit}, then the result of this method
290 * @param amountToAdd the amount of the specified unit t
297 plus(long amountToAdd, TemporalUnit unit) argument
369 minus(long amountToSubtract, TemporalUnit unit) argument
447 until(Temporal endExclusive, TemporalUnit unit) argument
[all...]
H A DTemporalAmount.java79 * A simple case might have a single unit-value pair, such as "6 hours".
80 * A more complex case may have multiple unit-value pairs, such as
102 * Returns the value of the requested unit.
105 * for each unit listed in {@code getUnits}.
112 * @param unit the {@code TemporalUnit} for which to return the value
113 * @return the long value of the unit
114 * @throws DateTimeException if a value for the unit cannot be obtained
115 * @throws UnsupportedTemporalTypeException if the {@code unit} is not supported
117 long get(TemporalUnit unit); argument
125 * of the unit
[all...]
/libcore/luni/src/test/java/libcore/java/time/
H A DOffsetTimeTest.java70 private static void assertPlusIsNoop(long amount, TemporalUnit unit) { argument
71 assertSame(NOON_UTC, NOON_UTC.plus(amount, unit));
76 for (ChronoUnit unit : EnumSet.range(ChronoUnit.DAYS, ChronoUnit.FOREVER)) {
78 NOON_UTC.plus(1, unit);
79 fail("Adding 1 " + unit + " should have failed.");
83 NOON_UTC.minus(1, unit);
84 fail("Subtracting 1 " + unit + " should have failed.");
/libcore/ojluni/src/main/java/java/nio/file/attribute/
H A DFileTime.java52 * The unit of granularity to interpret the value. Null if
54 * the {@code value} and {@code unit} pair will not be used
57 private final TimeUnit unit; field in class:FileTime
77 private FileTime(long value, TimeUnit unit, Instant instant) { argument
79 this.unit = unit;
84 * Returns a {@code FileTime} representing a value at the given unit of
90 * @param unit
91 * the unit of granularity to interpret the value
95 public static FileTime from(long value, TimeUnit unit) { argument
141 to(TimeUnit unit) argument
[all...]
/libcore/ojluni/src/main/java/java/time/chrono/
H A DChronoPeriod.java82 * The amount of a supported unit may be set to zero.
124 * Gets the value of the requested unit.
129 * Requesting an unsupported unit will throw an exception.
131 * @param unit the {@code TemporalUnit} for which to return the value
132 * @return the long value of the unit
133 * @throws DateTimeException if the unit is not supported
134 * @throws UnsupportedTemporalTypeException if the unit is not supported
137 long get(TemporalUnit unit); argument
173 for (TemporalUnit unit : getUnits()) {
174 if (get(unit) !
[all...]
H A DChronoLocalDateImpl.java198 public D plus(long amountToAdd, TemporalUnit unit) { argument
199 if (unit instanceof ChronoUnit) {
200 ChronoUnit f = (ChronoUnit) unit;
211 throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);
213 return (D) ChronoLocalDate.super.plus(amountToAdd, unit);
224 public D minus(long amountToSubtract, TemporalUnit unit) { argument
225 return (D) ChronoLocalDate.super.minus(amountToSubtract, unit);
376 public long until(Temporal endExclusive, TemporalUnit unit) { argument
379 if (unit instanceo
[all...]
H A DChronoLocalDate.java391 * Checks if the specified unit is supported.
393 * This checks if the specified unit can be added to or subtracted from this date.
400 * If the unit is not a {@code ChronoUnit}, then the result of this method
403 * Whether the unit is supported is determined by the unit.
405 * @param unit the unit to check, null returns false
406 * @return true if the unit can be added/subtracted, false if not
409 default boolean isSupported(TemporalUnit unit) { argument
410 if (unit instanceo
458 plus(long amountToAdd, TemporalUnit unit) argument
482 minus(long amountToSubtract, TemporalUnit unit) argument
598 until(Temporal endExclusive, TemporalUnit unit) argument
[all...]
/libcore/ojluni/src/main/java/java/lang/
H A DProcess.java178 * @param unit the time unit of the {@code timeout} argument
183 * @throws NullPointerException if unit is null
186 public boolean waitFor(long timeout, TimeUnit unit) argument
190 long rem = unit.toNanos(timeout);
201 rem = unit.toNanos(timeout) - (System.nanoTime() - startTime);
/libcore/ojluni/src/main/java/java/nio/file/
H A DWatchService.java146 * how to wait before giving up, in units of unit
147 * @param unit
159 WatchKey poll(long timeout, TimeUnit unit) argument
/libcore/ojluni/src/main/java/java/util/concurrent/locks/
H A DCondition.java313 * boolean aMethod(long timeout, TimeUnit unit) {
314 * long nanos = unit.toNanos(timeout);
365 * <pre> {@code awaitNanos(unit.toNanos(time)) > 0}</pre>
368 * @param unit the time unit of the {@code time} argument
374 boolean await(long time, TimeUnit unit) throws InterruptedException; argument
H A DLock.java315 * @param unit the time unit of the {@code time} argument
323 boolean tryLock(long time, TimeUnit unit) throws InterruptedException; argument
/libcore/ojluni/src/main/java/java/time/
H A DYearMonth.java357 * Checks if the specified unit is supported.
359 * This checks if the specified unit can be added to, or subtracted from, this year-month.
363 * If the unit is a {@link ChronoUnit} then the query is implemented here.
375 * If the unit is not a {@code ChronoUnit}, then the result of this method
378 * Whether the unit is supported is determined by the unit.
380 * @param unit the unit to check, null returns false
381 * @return true if the unit can be added/subtracted, false if not
384 public boolean isSupported(TemporalUnit unit) { argument
799 plus(long amountToAdd, TemporalUnit unit) argument
897 minus(long amountToSubtract, TemporalUnit unit) argument
1039 until(Temporal endExclusive, TemporalUnit unit) argument
[all...]
H A DInstant.java459 * Checks if the specified unit is supported.
461 * This checks if the specified unit can be added to, or subtracted from, this date-time.
465 * If the unit is a {@link ChronoUnit} then the query is implemented here.
479 * If the unit is not a {@code ChronoUnit}, then the result of this method
482 * Whether the unit is supported is determined by the unit.
484 * @param unit the unit to check, null returns false
485 * @return true if the unit can be added/subtracted, false if not
488 public boolean isSupported(TemporalUnit unit) { argument
742 truncatedTo(TemporalUnit unit) argument
844 plus(long amountToAdd, TemporalUnit unit) argument
972 minus(long amountToSubtract, TemporalUnit unit) argument
1137 until(Temporal endExclusive, TemporalUnit unit) argument
[all...]
H A DYear.java370 * Checks if the specified unit is supported.
372 * This checks if the specified unit can be added to, or subtracted from, this year.
376 * If the unit is a {@link ChronoUnit} then the query is implemented here.
387 * If the unit is not a {@code ChronoUnit}, then the result of this method
390 * Whether the unit is supported is determined by the unit.
392 * @param unit the unit to check, null returns false
393 * @return true if the unit can be added/subtracted, false if not
396 public boolean isSupported(TemporalUnit unit) { argument
702 plus(long amountToAdd, TemporalUnit unit) argument
778 minus(long amountToSubtract, TemporalUnit unit) argument
907 until(Temporal endExclusive, TemporalUnit unit) argument
[all...]

Completed in 292 milliseconds

1234