| 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 前 次 | フレームあり フレームなし | |||||||||
| TimeUnit を使用しているパッケージ | |
|---|---|
| java.util.concurrent | 並行プログラミングでよく使用されるユーティリティークラスです。 | 
| java.util.concurrent.locks | 組み込みの同期および監視と区別された状態のロックおよび待機用のフレームワークを提供するインタフェースおよびクラス。 | 
| javax.swing | すべてのプラットフォームで可能なかぎり同じように機能する「軽量」(Java 共通言語) コンポーネントのセットを提供します。 | 
| java.util.concurrent での TimeUnit の使用 | 
|---|
| TimeUnit を返す java.util.concurrent のメソッド | |
|---|---|
| static TimeUnit | TimeUnit.valueOf(String name)指定した名前を持つこの型の列挙型定数を返します。 | 
| static TimeUnit[] | TimeUnit.values()この列挙型の定数を含む配列を宣言されている順序で返します。 | 
| TimeUnit 型のパラメータを持つ java.util.concurrent のメソッド | ||
|---|---|---|
|  boolean | CountDownLatch.await(long timeout,
      TimeUnit unit)スレッドで割り込みが発生するか、指定された待機時間が経過しないかぎり、ラッチのカウントダウンがゼロになるまで現在のスレッドを待機させます。 | |
|  int | CyclicBarrier.await(long timeout,
      TimeUnit unit)すべてのパーティーがこのバリアーで await を呼び出すか、指定された待機時間が経過するまで待機します。 | |
|  boolean | ExecutorService.awaitTermination(long timeout,
                 TimeUnit unit)シャットダウン要求後にすべてのタスクが実行を完了していたか、タイムアウトが発生するか、現在のスレッドで割り込みが発生するか、そのいずれかが最初に発生するまでブロックします。 | |
|  boolean | ThreadPoolExecutor.awaitTermination(long timeout,
                 TimeUnit unit) | |
|  long | TimeUnit.convert(long sourceDuration,
        TimeUnit sourceUnit)指定された単位による指定された時間を、この単位に変換します。 | |
|  V | Exchanger.exchange(V x,
         long timeout,
         TimeUnit unit)現在のスレッドは、割り込みが発生するか、指定された待機時間が経過しないかぎり、もう一方のスレッドがこの交換ポイントに達するまで待機し、指定されたオブジェクトをそのスレッドに転送して、代わりにもう一方のスレッドのオブジェクトを受け取ります。 | |
|  V | Future.get(long timeout,
    TimeUnit unit)必要に応じて、最大で指定された時間、計算が完了するまで待機し、その後、計算結果が利用可能な場合は結果を取得します。 | |
|  V | FutureTask.get(long timeout,
    TimeUnit unit) | |
|  long | Delayed.getDelay(TimeUnit unit)特定のタイムユニットで、このオブジェクトと関連する残りの遅延を返します。 | |
|  long | ThreadPoolExecutor.getKeepAliveTime(TimeUnit unit)コアプールサイズを超えるスレッドが終了前にアイドル状態に留まることができる、スレッドのキープアライブ時間を返します。 | |
| 
 | AbstractExecutorService.invokeAll(Collection<? extends Callable<T>> tasks,
          long timeout,
          TimeUnit unit) | |
| 
 | ExecutorService.invokeAll(Collection<? extends Callable<T>> tasks,
          long timeout,
          TimeUnit unit)指定されたタスクを実行し、すべてが完了するか時間切れになるか、そのいずれかが最初に発生した時点で、ステータスと結果を含む Future のリストを返します。 | |
| 
 | AbstractExecutorService.invokeAny(Collection<? extends Callable<T>> tasks,
          long timeout,
          TimeUnit unit) | |
| 
 | ExecutorService.invokeAny(Collection<? extends Callable<T>> tasks,
          long timeout,
          TimeUnit unit)指定されたタスクを実行し、タイムアウトが経過する前に例外をスローせずに正常に完了したタスクが存在する場合は、その結果を返します。 | |
|  boolean | ArrayBlockingQueue.offer(E e,
      long timeout,
      TimeUnit unit)指定された要素をこのキューの末尾に挿入します。 | |
|  boolean | BlockingDeque.offer(E e,
      long timeout,
      TimeUnit unit)指定された要素をこの両端キューで表されるキュー (つまり、この両端キューの末尾) に挿入します。 | |
|  boolean | BlockingQueue.offer(E e,
      long timeout,
      TimeUnit unit)指定された要素をこのキューに挿入します。 | |
|  boolean | DelayQueue.offer(E e,
      long timeout,
      TimeUnit unit)指定された要素をこの遅延キューに挿入します。 | |
|  boolean | LinkedBlockingDeque.offer(E e,
      long timeout,
      TimeUnit unit) | |
|  boolean | LinkedBlockingQueue.offer(E e,
      long timeout,
      TimeUnit unit)指定された要素をこのキューの末尾に挿入します。 | |
|  boolean | PriorityBlockingQueue.offer(E e,
      long timeout,
      TimeUnit unit)指定された要素をこの優先度キューに挿入します。 | |
|  boolean | SynchronousQueue.offer(E o,
      long timeout,
      TimeUnit unit)指定された要素をこのキューに挿入します。 | |
|  boolean | BlockingDeque.offerFirst(E e,
           long timeout,
           TimeUnit unit)指定された要素をこの両端キューの先頭に挿入します。 | |
|  boolean | LinkedBlockingDeque.offerFirst(E e,
           long timeout,
           TimeUnit unit) | |
|  boolean | BlockingDeque.offerLast(E e,
          long timeout,
          TimeUnit unit)指定された要素をこの両端キューの末尾に挿入します。 | |
|  boolean | LinkedBlockingDeque.offerLast(E e,
          long timeout,
          TimeUnit unit) | |
|  E | ArrayBlockingQueue.poll(long timeout,
     TimeUnit unit) | |
|  E | BlockingDeque.poll(long timeout,
     TimeUnit unit)この両端キューによって表されるキューの先頭 (つまり、この両端キューの最初の要素) を取得して削除します。 | |
|  E | BlockingQueue.poll(long timeout,
     TimeUnit unit)このキューの先頭を取得して削除します。 | |
|  Future<V> | CompletionService.poll(long timeout,
     TimeUnit unit)次の完了済みタスクを表す Future を取得して削除します。 | |
|  E | DelayQueue.poll(long timeout,
     TimeUnit unit)このキューの先頭を取得および削除します。 | |
|  Future<V> | ExecutorCompletionService.poll(long timeout,
     TimeUnit unit) | |
|  E | LinkedBlockingDeque.poll(long timeout,
     TimeUnit unit) | |
|  E | LinkedBlockingQueue.poll(long timeout,
     TimeUnit unit) | |
|  E | PriorityBlockingQueue.poll(long timeout,
     TimeUnit unit) | |
|  E | SynchronousQueue.poll(long timeout,
     TimeUnit unit)このキューの先頭を取得および削除します。 | |
|  E | BlockingDeque.pollFirst(long timeout,
          TimeUnit unit)この両端キューの最初の要素を取得して削除します。 | |
|  E | LinkedBlockingDeque.pollFirst(long timeout,
          TimeUnit unit) | |
|  E | BlockingDeque.pollLast(long timeout,
         TimeUnit unit)この両端キューの最後の要素を取得して削除します。 | |
|  E | LinkedBlockingDeque.pollLast(long timeout,
         TimeUnit unit) | |
| 
 | ScheduledExecutorService.schedule(Callable<V> callable,
         long delay,
         TimeUnit unit)指定された遅延後に有効になる ScheduledFuture を作成して実行します。 | |
| 
 | ScheduledThreadPoolExecutor.schedule(Callable<V> callable,
         long delay,
         TimeUnit unit) | |
|  ScheduledFuture<?> | ScheduledExecutorService.schedule(Runnable command,
         long delay,
         TimeUnit unit)指定された遅延後に有効になる単発的なアクションを作成して実行します。 | |
|  ScheduledFuture<?> | ScheduledThreadPoolExecutor.schedule(Runnable command,
         long delay,
         TimeUnit unit) | |
|  ScheduledFuture<?> | ScheduledExecutorService.scheduleAtFixedRate(Runnable command,
                    long initialDelay,
                    long period,
                    TimeUnit unit)指定された初期遅延の経過後にはじめて有効になり、その後は指定された期間ごとに有効になる定期的なアクションを作成して実行します。 | |
|  ScheduledFuture<?> | ScheduledThreadPoolExecutor.scheduleAtFixedRate(Runnable command,
                    long initialDelay,
                    long period,
                    TimeUnit unit) | |
|  ScheduledFuture<?> | ScheduledExecutorService.scheduleWithFixedDelay(Runnable command,
                       long initialDelay,
                       long delay,
                       TimeUnit unit)指定された初期遅延の経過後にはじめて有効になり、その後は実行の終了後から次の開始までの指定の遅延ごとに有効になる定期的なアクションを作成して実行します。 | |
|  ScheduledFuture<?> | ScheduledThreadPoolExecutor.scheduleWithFixedDelay(Runnable command,
                       long initialDelay,
                       long delay,
                       TimeUnit unit) | |
|  void | ThreadPoolExecutor.setKeepAliveTime(long time,
                 TimeUnit unit)スレッドが終了前にアイドル状態に留まることができる制限時間を設定します。 | |
|  boolean | Semaphore.tryAcquire(int permits,
           long timeout,
           TimeUnit unit)指定された待機時間内で指定された数のパーミットが利用可能であり、現在のスレッドで 割り込み が発生していない場合に、このセマフォーから指定された数のパーミットを取得します。 | |
|  boolean | Semaphore.tryAcquire(long timeout,
           TimeUnit unit)指定された待機時間内でパーミットが利用可能になり、現在のスレッドで 割り込み が発生していない場合に、このセマフォーからパーミットを取得します。 | |
| TimeUnit 型のパラメータを持つ java.util.concurrent のコンストラクタ | |
|---|---|
| ThreadPoolExecutor(int corePoolSize,
                   int maximumPoolSize,
                   long keepAliveTime,
                   TimeUnit unit,
                   BlockingQueue<Runnable> workQueue)指定された初期パラメータ、およびデフォルトのスレッドファクトリと拒否された実行ハンドラを使用して、新しい ThreadPoolExecutor を作成します。 | |
| ThreadPoolExecutor(int corePoolSize,
                   int maximumPoolSize,
                   long keepAliveTime,
                   TimeUnit unit,
                   BlockingQueue<Runnable> workQueue,
                   RejectedExecutionHandler handler)指定された初期パラメータ、およびデフォルトのスレッドファクトリを使用して、新しい ThreadPoolExecutor を作成します。 | |
| ThreadPoolExecutor(int corePoolSize,
                   int maximumPoolSize,
                   long keepAliveTime,
                   TimeUnit unit,
                   BlockingQueue<Runnable> workQueue,
                   ThreadFactory threadFactory)指定された初期パラメータ、およびデフォルトの拒否された実行ハンドラを使用して、新しい ThreadPoolExecutor を作成します。 | |
| ThreadPoolExecutor(int corePoolSize,
                   int maximumPoolSize,
                   long keepAliveTime,
                   TimeUnit unit,
                   BlockingQueue<Runnable> workQueue,
                   ThreadFactory threadFactory,
                   RejectedExecutionHandler handler)指定された初期パラメータを使って、新しい ThreadPoolExecutor を作成します。 | |
| java.util.concurrent.locks での TimeUnit の使用 | 
|---|
| TimeUnit 型のパラメータを持つ java.util.concurrent.locks のメソッド | |
|---|---|
|  boolean | AbstractQueuedLongSynchronizer.ConditionObject.await(long time,
      TimeUnit unit)時間の指定された状態待機を実装します。 | 
|  boolean | AbstractQueuedSynchronizer.ConditionObject.await(long time,
      TimeUnit unit)時間の指定された状態待機を実装します。 | 
|  boolean | Condition.await(long time,
      TimeUnit unit)信号が送信される、割り込みが発生する、または指定された待機時間が経過するまで、現在のスレッドを待機させます。 | 
|  boolean | Lock.tryLock(long time,
        TimeUnit unit)指定された待機時間内でロックが利用可能であり、現在のスレッドで割り込みが発生していない場合に、ロックを取得します。 | 
|  boolean | ReentrantLock.tryLock(long timeout,
        TimeUnit unit)指定された待機時間内に別のスレッドがロックを保持せず、現在のスレッドで割り込みが発生していない場合に、ロックを取得します。 | 
|  boolean | ReentrantReadWriteLock.ReadLock.tryLock(long timeout,
        TimeUnit unit)指定された待機時間内に別のスレッドが書き込みロックを保持せず、現在のスレッドで割り込みが発生していない場合に、読み込みロックを取得します。 | 
|  boolean | ReentrantReadWriteLock.WriteLock.tryLock(long timeout,
        TimeUnit unit)指定された待機時間内に別のスレッドがロックを保持せず、現在のスレッドで割り込みが発生していない場合に、書き込みロックを取得します。 | 
| javax.swing での TimeUnit の使用 | 
|---|
| TimeUnit 型のパラメータを持つ javax.swing のメソッド | |
|---|---|
|  T | SwingWorker.get(long timeout,
    TimeUnit unit)必要に応じて、最大で指定された時間、計算が完了するまで待機し、その後、計算結果が利用可能な場合は結果を取得します。 | 
| 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 前 次 | フレームあり フレームなし | |||||||||
Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。