public class AtomicDisposableReferenceCounter extends Object
| Constructor and Description |
|---|
AtomicDisposableReferenceCounter() |
AtomicDisposableReferenceCounter(int disposeOnReferenceCount) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
decrement()
Decrements the reference count and returns whether the reference counter entered the disposed
state.
|
boolean |
disposeIfNotUsed() |
int |
get() |
boolean |
increment()
Increments the reference count and returns whether it was successful.
|
boolean |
isDisposed()
Returns whether the reference count has reached the disposed state.
|
public AtomicDisposableReferenceCounter()
public AtomicDisposableReferenceCounter(int disposeOnReferenceCount)
public boolean increment()
If the method returns false, the counter has already been disposed. Otherwise it
returns true.
public boolean decrement()
If the method returns true, the decrement operation disposed the counter.
Otherwise it returns false.
public int get()
public boolean isDisposed()
public boolean disposeIfNotUsed()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.