TimeUnit


TimeUnit java.util.concurrent

Java 5.0 serializable comparable enum

The constants defined by this enumerated type represent granularities of time. Timeout and delay specifications throughout the java.util.concurrent package are specified by a long value and TimeUnit constant that specifies the interpretation of that value.

TimeUnit defines conversion methods that convert values expressed in one unit to values in another unit. More interestingly, it defines convenient alternatives to THRead.sleep( ) , Thread.join( ) , and Object.wait( ) .

Figure 16-96. java.util.concurrent.TimeUnit

 public enum  TimeUnit  {  // Enumerated Constants   NANOSECONDS  ,  MICROSECONDS  ,  MILLISECONDS  ,  SECONDS  ;  // Public Class Methods  public static TimeUnit  valueOf  (String  name  );        public static final TimeUnit[ ]  values  ( );  // Public Instance Methods  public long  convert  (long  duration  , TimeUnit  unit  );        public void  sleep  (long  timeout  ) throws InterruptedException;        public void  timedJoin  (Thread  thread  , long  timeout  ) throws InterruptedException;        public void  timedWait  (Object  obj  , long  timeout  ) throws InterruptedException;        public long  toMicros  (long  duration  );        public long  toMillis  (long  duration  );        public long  toNanos  (long  duration  );        public long  toSeconds  (long  duration  );   } 

Passed To

Too many methods to list.



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net