Package org.nd4j.linalg.util
Class AtomicThrowable
- java.lang.Object
-
- org.nd4j.linalg.util.AtomicThrowable
-
public class AtomicThrowable extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected ReentrantReadWriteLock
lock
protected Throwable
t
-
Constructor Summary
Constructors Constructor Description AtomicThrowable()
This method creates new instanceAtomicThrowable(Exception e)
This method creates new instance with given initial state
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Throwable
get()
This method returns current stateboolean
isTriggered()
This method returns TRUE if internal state holds error, FALSE otherwisevoid
set(Throwable t)
This method updates state with given Throwablevoid
setIfFirst(Throwable t)
This method updates state only if it wasn't set before
-
-
-
Field Detail
-
t
protected volatile Throwable t
-
lock
protected ReentrantReadWriteLock lock
-
-
Constructor Detail
-
AtomicThrowable
public AtomicThrowable()
This method creates new instance
-
AtomicThrowable
public AtomicThrowable(Exception e)
This method creates new instance with given initial state- Parameters:
e
-
-
-
Method Detail
-
get
public Throwable get()
This method returns current state- Returns:
-
set
public void set(Throwable t)
This method updates state with given Throwable- Parameters:
t
-
-
setIfFirst
public void setIfFirst(Throwable t)
This method updates state only if it wasn't set before- Parameters:
t
-
-
isTriggered
public boolean isTriggered()
This method returns TRUE if internal state holds error, FALSE otherwise- Returns:
-
-