Package org.eolang
Class UniverseSafe
- java.lang.Object
-
- org.eolang.UniverseSafe
-
- All Implemented Interfaces:
Universe
public final class UniverseSafe extends Object implements Universe
Universe
to be used from within native function.Since we cannot save stacktrace of exception inside native code (we can only detect it), we should keep it on the java side. More detailed: www.developer.com/open-source/exception-handling-in-jni, stackoverflow.com/questions/2054598/how-to-catch-jni-java-exception, www.iitk.ac.in/esc101/05Aug/tutorial/native1.1/implementing/error.html
- Since:
- 0.32
-
-
Constructor Summary
Constructors Constructor Description UniverseSafe(UniverseDefault origin, AtomicReference<Throwable> throwable)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(int parent, int child, String att)
Binds child to parent.int
copy(int vertex)
Copies the eo object.byte[]
dataize(int vertex)
Dataizes the eo object by vertex and return byte array.int
find(String name)
Finds vertex of eo object by its location.void
put(int vertex, byte[] bytes)
Puts data to eo object by vertex.
-
-
-
Constructor Detail
-
UniverseSafe
public UniverseSafe(UniverseDefault origin, AtomicReference<Throwable> throwable)
Ctor.- Parameters:
origin
- Origin.throwable
- A cell to keep throwable.
-
-
Method Detail
-
find
public int find(String name)
Description copied from interface:Universe
Finds vertex of eo object by its location.
-
put
public void put(int vertex, byte[] bytes)
Description copied from interface:Universe
Puts data to eo object by vertex.
-
bind
public void bind(int parent, int child, String att)
Description copied from interface:Universe
Binds child to parent.
-
copy
public int copy(int vertex)
Description copied from interface:Universe
Copies the eo object.
-
-