GraphLab: Distributed Graph-Parallel API
2.1
|
#include <graphlab/jni/java_any.hpp>
Public Member Functions | |
java_any (JNIEnv *env, jobject &obj) | |
java_any () | |
java_any (const java_any &other) | |
java_any & | operator= (const java_any &other) |
jobject & | obj () |
const jobject & | obj () const |
~java_any () |
Protected Member Functions | |
void | set_obj (jobject obj) |
bool | handle_exception (JNIEnv *env) const |
Generic wrapper for Java objects (jobject). It creates a NewGlobalRef on the jobject in the default constructor, and deletes the GlobalRef in the destructor. An assignment operator is also provided to deal with creating and deleting edges. Subclasses should provide a copy constructor, and there are two scenarios: NewGlobalRef during copy, or object clone during copy.
Definition at line 42 of file java_any.hpp.
java_any::java_any | ( | JNIEnv * | env, |
jobject & | obj | ||
) |
Constructor for java_any. Initializes this object with the associated Java object.
[in] | env | JNI environment - used to create a new reference to obj |
[in] | obj | Java object. This constructor will create a new reference to the object to prevent garbage collection. |
Definition at line 39 of file java_any.cpp.
java_any::java_any | ( | ) |
The default constructor does nothing. mobj is initialized to NULL.
Definition at line 44 of file java_any.cpp.
java_any::java_any | ( | const java_any & | other | ) |
Copy constructor If other
has a reference to a java object, increases the reference count. Child classes may wish to override this to implement clone behavior.
Definition at line 54 of file java_any.cpp.
java_any::~java_any | ( | ) |
Deletes the reference to the Java object so that it may be garbage collected.
Definition at line 109 of file java_any.cpp.
|
protected |
Checks for and rethrows Java exceptions.
[in] | env | JNI environment |
Definition at line 117 of file java_any.cpp.
jobject & java_any::obj | ( | ) |
Retrieves the associated Java object
Definition at line 46 of file java_any.cpp.
Copy assignment operator for java_any. If other
has a mobj
, creates a new reference to it.
Definition at line 68 of file java_any.cpp.
|
protected |
Deletes the current ref (if any) and creates a new ref if obj
is not null.
[in] | obj | replaces current object ref |
Definition at line 93 of file java_any.cpp.