Liking cljdoc? Tell your friends :D

jdk.util.concurrent.atomic.AtomicLong

A long value that may be updated atomically. See the java.util.concurrent.atomic package specification for description of the properties of atomic variables. An AtomicLong is used in applications such as atomically incremented sequence numbers, and cannot be used as a replacement for a Long. However, this class does extend Number to allow uniform access by tools and utilities that deal with numerically-based classes.

A long value that may be updated atomically.  See the
java.util.concurrent.atomic package specification for
description of the properties of atomic variables. An
AtomicLong is used in applications such as atomically
incremented sequence numbers, and cannot be used as a replacement
for a Long. However, this class does extend
Number to allow uniform access by tools and utilities that
deal with numerically-based classes.
raw docstring

->atomic-longclj

(->atomic-long)
(->atomic-long initial-value)

Constructor.

Creates a new AtomicLong with the given initial value.

initial-value - the initial value - long

Constructor.

Creates a new AtomicLong with the given initial value.

initial-value - the initial value - `long`
raw docstring

accumulate-and-getclj

(accumulate-and-get this x accumulator-function)

Atomically updates the current value with the results of applying the given function to the current and given values, returning the updated value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads. The function is applied with the current value as its first argument, and the given update as the second argument.

x - the update value - long accumulator-function - a side-effect-free function of two arguments - java.util.function.LongBinaryOperator

returns: the updated value - long

Atomically updates the current value with the results of
 applying the given function to the current and given values,
 returning the updated value. The function should be
 side-effect-free, since it may be re-applied when attempted
 updates fail due to contention among threads.  The function
 is applied with the current value as its first argument,
 and the given update as the second argument.

x - the update value - `long`
accumulator-function - a side-effect-free function of two arguments - `java.util.function.LongBinaryOperator`

returns: the updated value - `long`
raw docstring

add-and-getclj

(add-and-get this delta)

Atomically adds the given value to the current value.

delta - the value to add - long

returns: the updated value - long

Atomically adds the given value to the current value.

delta - the value to add - `long`

returns: the updated value - `long`
raw docstring

compare-and-setclj

(compare-and-set this expect update)

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

expect - the expected value - long update - the new value - long

returns: true if successful. False return indicates that the actual value was not equal to the expected value. - boolean

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

expect - the expected value - `long`
update - the new value - `long`

returns: true if successful. False return indicates that
 the actual value was not equal to the expected value. - `boolean`
raw docstring

decrement-and-getclj

(decrement-and-get this)

Atomically decrements by one the current value.

returns: the updated value - long

Atomically decrements by one the current value.

returns: the updated value - `long`
raw docstring

double-valueclj

(double-value this)

Returns the value of this AtomicLong as a double after a widening primitive conversion.

returns: the numeric value represented by this object after conversion to type double. - double

Returns the value of this AtomicLong as a double
 after a widening primitive conversion.

returns: the numeric value represented by this object after conversion
          to type double. - `double`
raw docstring

float-valueclj

(float-value this)

Returns the value of this AtomicLong as a float after a widening primitive conversion.

returns: the numeric value represented by this object after conversion to type float. - float

Returns the value of this AtomicLong as a float
 after a widening primitive conversion.

returns: the numeric value represented by this object after conversion
          to type float. - `float`
raw docstring

getclj

(get this)

Gets the current value.

returns: the current value - long

Gets the current value.

returns: the current value - `long`
raw docstring

get-and-accumulateclj

(get-and-accumulate this x accumulator-function)

Atomically updates the current value with the results of applying the given function to the current and given values, returning the previous value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads. The function is applied with the current value as its first argument, and the given update as the second argument.

x - the update value - long accumulator-function - a side-effect-free function of two arguments - java.util.function.LongBinaryOperator

returns: the previous value - long

Atomically updates the current value with the results of
 applying the given function to the current and given values,
 returning the previous value. The function should be
 side-effect-free, since it may be re-applied when attempted
 updates fail due to contention among threads.  The function
 is applied with the current value as its first argument,
 and the given update as the second argument.

x - the update value - `long`
accumulator-function - a side-effect-free function of two arguments - `java.util.function.LongBinaryOperator`

returns: the previous value - `long`
raw docstring

get-and-addclj

(get-and-add this delta)

Atomically adds the given value to the current value.

delta - the value to add - long

returns: the previous value - long

Atomically adds the given value to the current value.

delta - the value to add - `long`

returns: the previous value - `long`
raw docstring

get-and-decrementclj

(get-and-decrement this)

Atomically decrements by one the current value.

returns: the previous value - long

Atomically decrements by one the current value.

returns: the previous value - `long`
raw docstring

get-and-incrementclj

(get-and-increment this)

Atomically increments by one the current value.

returns: the previous value - long

Atomically increments by one the current value.

returns: the previous value - `long`
raw docstring

get-and-setclj

(get-and-set this new-value)

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

new-value - the new value - long

returns: the previous value - long

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

new-value - the new value - `long`

returns: the previous value - `long`
raw docstring

get-and-updateclj

(get-and-update this update-function)

Atomically updates the current value with the results of applying the given function, returning the previous value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads.

update-function - a side-effect-free function - java.util.function.LongUnaryOperator

returns: the previous value - long

Atomically updates the current value with the results of
 applying the given function, returning the previous value. The
 function should be side-effect-free, since it may be re-applied
 when attempted updates fail due to contention among threads.

update-function - a side-effect-free function - `java.util.function.LongUnaryOperator`

returns: the previous value - `long`
raw docstring

increment-and-getclj

(increment-and-get this)

Atomically increments by one the current value.

returns: the updated value - long

Atomically increments by one the current value.

returns: the updated value - `long`
raw docstring

int-valueclj

(int-value this)

Returns the value of this AtomicLong as an int after a narrowing primitive conversion.

returns: the numeric value represented by this object after conversion to type int. - int

Returns the value of this AtomicLong as an int
 after a narrowing primitive conversion.

returns: the numeric value represented by this object after conversion
          to type int. - `int`
raw docstring

lazy-setclj

(lazy-set this new-value)

Eventually sets to the given value.

new-value - the new value - long

Eventually sets to the given value.

new-value - the new value - `long`
raw docstring

long-valueclj

(long-value this)

Returns the value of this AtomicLong as a long.

returns: the numeric value represented by this object after conversion to type long. - long

Returns the value of this AtomicLong as a long.

returns: the numeric value represented by this object after conversion
          to type long. - `long`
raw docstring

setclj

(set this new-value)

Sets to the given value.

new-value - the new value - long

Sets to the given value.

new-value - the new value - `long`
raw docstring

to-stringclj

(to-string this)

Returns the String representation of the current value.

returns: the String representation of the current value - java.lang.String

Returns the String representation of the current value.

returns: the String representation of the current value - `java.lang.String`
raw docstring

update-and-getclj

(update-and-get this update-function)

Atomically updates the current value with the results of applying the given function, returning the updated value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads.

update-function - a side-effect-free function - java.util.function.LongUnaryOperator

returns: the updated value - long

Atomically updates the current value with the results of
 applying the given function, returning the updated value. The
 function should be side-effect-free, since it may be re-applied
 when attempted updates fail due to contention among threads.

update-function - a side-effect-free function - `java.util.function.LongUnaryOperator`

returns: the updated value - `long`
raw docstring

weak-compare-and-setclj

(weak-compare-and-set this expect update)

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

May fail spuriously and does not provide ordering guarantees, so is only rarely an appropriate alternative to compareAndSet.

expect - the expected value - long update - the new value - long

returns: true if successful - boolean

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

 May fail
 spuriously and does not provide ordering guarantees, so is
 only rarely an appropriate alternative to compareAndSet.

expect - the expected value - `long`
update - the new value - `long`

returns: true if successful - `boolean`
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close