Example usage for java.util.concurrent.atomic AtomicIntegerArray getAndIncrement

List of usage examples for java.util.concurrent.atomic AtomicIntegerArray getAndIncrement

Introduction

In this page you can find the example usage for java.util.concurrent.atomic AtomicIntegerArray getAndIncrement.

Prototype

public final int getAndIncrement(int i) 

Source Link

Document

Atomically increments the value of the element at index i , with memory effects as specified by VarHandle#getAndAdd .

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    AtomicIntegerArray atomicIntegerArray = new AtomicIntegerArray(new int[] { 0, 1, 2, 3 });

    atomicIntegerArray.getAndIncrement(0);

    System.out.println(atomicIntegerArray);
}