AtomicBoolean


AtomicBoolean java.util.concurrent.atomic

Java 5.0 serializable

This threadsafe class holds a boolean value. In addition to the get( ) and set( ) iterators, it provides atomic compareAndSet( ) , weakCompareAndSet( ) , and getAndSet( ) operations.

Figure 16-97. java.util.concurrent.atomic.AtomicBoolean

 public class  AtomicBoolean  implements Serializable {  // Public Constructors  public  AtomicBoolean  ( );        public  AtomicBoolean  (boolean  initialValue  );  // Public Instance Methods  public final boolean  compareAndSet  (boolean  expect  , boolean  update  );        public final boolean  get  ( );        public final boolean  getAndSet  (boolean  newValue  );        public final void  set  (boolean  newValue  );        public boolean  weakCompareAndSet  (boolean  expect  , boolean  update  );  // Public Methods Overriding Object  public String  toString  ( );   } 



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