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

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

Introduction

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

Prototype

public final int decrementAndGet(int i) 

Source Link

Document

Atomically decrements 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.decrementAndGet(0);

    System.out.println(atomicIntegerArray);
}