Package org.eolang
Class UniverseSafe
- java.lang.Object
-
- org.eolang.UniverseSafe
-
- All Implemented Interfaces:
Universe
public final class UniverseSafe extends Object implements Universe
Universeto 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 voidbind(int parent, int child, String att)Binds child to parent.intcopy(int vertex)Copies the eo object.byte[]dataize(int vertex)Dataizes the eo object by vertex and return byte array.intfind(String name)Finds vertex of eo object by its location.voidput(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:UniverseFinds vertex of eo object by its location.
-
put
public void put(int vertex, byte[] bytes)Description copied from interface:UniversePuts data to eo object by vertex.
-
bind
public void bind(int parent, int child, String att)Description copied from interface:UniverseBinds child to parent.
-
copy
public int copy(int vertex)
Description copied from interface:UniverseCopies the eo object.
-
-