0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This file is available under and governed by the GNU General Public 0N/A * License version 2 only, as published by the Free Software Foundation. 0N/A * However, the following notice accompanied the original version of this 0N/A * Written by Doug Lea with assistance from members of JCP JSR-166 0N/A * Expert Group and released to the public domain, as explained at 0N/A * An {@code int} value that may be updated atomically. See the 0N/A * {@link java.util.concurrent.atomic} package specification for 0N/A * description of the properties of atomic variables. An 0N/A * {@code AtomicInteger} is used in applications such as atomically 0N/A * incremented counters, and cannot be used as a replacement for an 0N/A * {@link java.lang.Integer}. However, this class does extend 0N/A * {@code Number} to allow uniform access by tools and utilities that 0N/A * deal with numerically-based classes. 0N/A // setup to use Unsafe.compareAndSwapInt for updates 0N/A * Creates a new AtomicInteger with the given initial value. 0N/A * @param initialValue the initial value 0N/A * Creates a new AtomicInteger with initial value {@code 0}. 0N/A * Gets the current value. 0N/A * @return the current value 0N/A * Sets to the given value. 0N/A * @param newValue the new value 0N/A * Eventually sets to the given value. 0N/A * @param newValue the new value 0N/A * Atomically sets to the given value and returns the old value. 0N/A * @param newValue the new value 0N/A * @return the previous value 0N/A * Atomically sets the value to the given updated value 0N/A * if the current value {@code ==} the expected value. 0N/A * @param expect the expected value 0N/A * @param update the new value 0N/A * @return true if successful. False return indicates that 0N/A * the actual value was not equal to the expected value. 0N/A * Atomically sets the value to the given updated value 0N/A * if the current value {@code ==} the expected value. 0N/A * and does not provide ordering guarantees, so is only rarely an 0N/A * appropriate alternative to {@code compareAndSet}. 0N/A * @param expect the expected value 0N/A * @param update the new value 0N/A * @return true if successful. 0N/A * Atomically increments by one the current value. 0N/A * @return the previous value 0N/A * Atomically decrements by one the current value. 0N/A * @return the previous value 0N/A * Atomically adds the given value to the current value. 0N/A * @param delta the value to add 0N/A * @return the previous value 0N/A * Atomically increments by one the current value. 0N/A * @return the updated value 0N/A * Atomically decrements by one the current value. 0N/A * @return the updated value 0N/A * Atomically adds the given value to the current value. 0N/A * @param delta the value to add 0N/A * @return the updated value 0N/A * Returns the String representation of the current value. 0N/A * @return the String representation of the current value.