Java Doc for AtomicIntegerFieldUpdater.java in  » Apache-Harmony-Java-SE » java-package » java » util » concurrent » atomic » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » java package » java.util.concurrent.atomic 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.concurrent.atomic.AtomicIntegerFieldUpdater

AtomicIntegerFieldUpdater
abstract public class AtomicIntegerFieldUpdater (Code)
A reflection-based utility that enables atomic updates to designated volatile int fields of designated classes. This class is designed for use in atomic data structures in which several fields of the same node are independently subject to atomic updates.

Note that the guarantees of the compareAndSet method in this class are weaker than in other atomic classes. Because this class cannot ensure that all uses of the field are appropriate for purposes of atomic access, it can guarantee atomicity and volatile semantics only with respect to other invocations of compareAndSet and set.
since:
   1.5
author:
   Doug Lea<
Parameters:
  T - > The type of the object holding the updatable field




Constructor Summary
protected  AtomicIntegerFieldUpdater()
     Protected do-nothing constructor for use by subclasses.

Method Summary
public  intaddAndGet(T obj, int delta)
     Atomically add the given value to current value.
abstract public  booleancompareAndSet(T obj, int expect, int update)
     Atomically set the value of the field of the given object managed by this Updater to the given updated value if the current value == the expected value.
public  intdecrementAndGet(T obj)
     Atomically decrement by one the current value.
abstract public  intget(T obj)
     Get the current value held in the field by the given object.
public  intgetAndAdd(T obj, int delta)
     Atomically add the given value to current value.
public  intgetAndDecrement(T obj)
     Atomically decrement by one the current value.
public  intgetAndIncrement(T obj)
     Atomically increment by one the current value.
public  intgetAndSet(T obj, int newValue)
     Set to the given value and return the old value.
public  intincrementAndGet(T obj)
     Atomically increment by one the current value.
public static  AtomicIntegerFieldUpdater<U>newUpdater(Class<U> tclass, String fieldName)
     Creates an updater for objects with the given field.
abstract public  voidset(T obj, int newValue)
     Set the field of the given object managed by this updater.
abstract public  booleanweakCompareAndSet(T obj, int expect, int update)
     Atomically set the value of the field of the given object managed by this Updater to the given updated value if the current value == the expected value.


Constructor Detail
AtomicIntegerFieldUpdater
protected AtomicIntegerFieldUpdater()(Code)
Protected do-nothing constructor for use by subclasses.




Method Detail
addAndGet
public int addAndGet(T obj, int delta)(Code)
Atomically add the given value to current value.
Parameters:
  obj - An object whose field to get and set
Parameters:
  delta - the value to add the updated value;



compareAndSet
abstract public boolean compareAndSet(T obj, int expect, int update)(Code)
Atomically set the value of the field of the given object managed by this Updater to the given updated value if the current value == the expected value. This method is guaranteed to be atomic with respect to other calls to compareAndSet and set, but not necessarily with respect to other changes in the field.
Parameters:
  obj - An object whose field to conditionally set
Parameters:
  expect - the expected value
Parameters:
  update - the new value true if successful.
throws:
  ClassCastException - if obj is not an instanceof the class possessing the field established in the constructor.



decrementAndGet
public int decrementAndGet(T obj)(Code)
Atomically decrement by one the current value.
Parameters:
  obj - An object whose field to get and set the updated value;



get
abstract public int get(T obj)(Code)
Get the current value held in the field by the given object.
Parameters:
  obj - An object whose field to get the current value



getAndAdd
public int getAndAdd(T obj, int delta)(Code)
Atomically add the given value to current value.
Parameters:
  obj - An object whose field to get and set
Parameters:
  delta - the value to add the previous value;



getAndDecrement
public int getAndDecrement(T obj)(Code)
Atomically decrement by one the current value.
Parameters:
  obj - An object whose field to get and set the previous value;



getAndIncrement
public int getAndIncrement(T obj)(Code)
Atomically increment by one the current value.
Parameters:
  obj - An object whose field to get and set the previous value;



getAndSet
public int getAndSet(T obj, int newValue)(Code)
Set to the given value and return the old value.
Parameters:
  obj - An object whose field to get and set
Parameters:
  newValue - the new value the previous value



incrementAndGet
public int incrementAndGet(T obj)(Code)
Atomically increment by one the current value.
Parameters:
  obj - An object whose field to get and set the updated value;



newUpdater
public static AtomicIntegerFieldUpdater<U> newUpdater(Class<U> tclass, String fieldName)(Code)
Creates an updater for objects with the given field. The Class argument is needed to check that reflective types and generic types match.
Parameters:
  tclass - the class of the objects holding the field
Parameters:
  fieldName - the name of the field to be updated. the updater
throws:
  IllegalArgumentException - if the field is not avolatile integer type.
throws:
  RuntimeException - with a nested reflection-basedexception if the class does not hold field or is the wrong type.



set
abstract public void set(T obj, int newValue)(Code)
Set the field of the given object managed by this updater. This operation is guaranteed to act as a volatile store with respect to subsequent invocations of compareAndSet.
Parameters:
  obj - An object whose field to set
Parameters:
  newValue - the new value



weakCompareAndSet
abstract public boolean weakCompareAndSet(T obj, int expect, int update)(Code)
Atomically set the value of the field of the given object managed by this Updater to the given updated value if the current value == the expected value. This method is guaranteed to be atomic with respect to other calls to compareAndSet and set, but not necessarily with respect to other changes in the field, and may fail spuriously.
Parameters:
  obj - An object whose field to conditionally set
Parameters:
  expect - the expected value
Parameters:
  update - the new value true if successful.
throws:
  ClassCastException - if obj is not an instanceof the class possessing the field established in the constructor.



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.