org.mapdb / Atomic / Integer

Integer

class Integer : Number

An int record that may be updated atomically. An Atomic@Integer is used in applications such as atomically incremented counters, and cannot be used as a replacement for an java.lang.Integer. However, this class does extend Number to allow uniform access by tools and utilities that deal with numerically-based classes.



Constructors

<init> Integer(store: Store, recid: Long)

Functions

addAndGet fun addAndGet(delta: Int): Int

Atomically adds the given value to the current value.

compareAndSet fun compareAndSet(expect: Int, update: Int): Boolean

Atomically sets the value to the given updated value if the current value == the expected value.

decrementAndGet fun decrementAndGet(): Int

Atomically decrements by one the current value.

get fun get(): Int

Gets the current value.

getAndAdd fun getAndAdd(delta: Int): Int

Atomically adds the given value to the current value.

getAndDecrement fun getAndDecrement(): Int

Atomically decrements by one the current value.

getAndIncrement fun getAndIncrement(): Int

Atomically increments by one the current value.

getAndSet fun getAndSet(newValue: Int): Int

Atomically sets to the given value and returns the old value.

getRecid fun getRecid(): Long

incrementAndGet fun incrementAndGet(): Int

Atomically increments by one the current value.

set fun set(newValue: Int): Unit

Sets to the given value.

toDouble fun toDouble(): Double
toFloat fun toFloat(): Float
toInt fun toInt(): Int
toLong fun toLong(): Long
toString fun toString(): String

Returns the String representation of the current value.