title: Return C++ object to Java
body: <p>I got a couple of JNI functions that have to work on the same c++ object. I would like to save that object in the java object through which the JNI functions are invoked, but it seems that Java has no way to store pointers for functions to access later.</p>
  
  <p>Okay I realize that I'm doing a terrible job explaining myself so here is an example:</p>
  
  <pre><code>void clear_numbers(JNIEnv *env, jobject me) {
     me.myCppVector.clear();
  }
  
  void set_number(JNIEnv *env, jobject me, jint index, jint num) {
     me.myCppVector[index]=num;
  }
  
  jint get_number(JNIEnv *env, jobject me, jint index) {
     returnme.myCppVector[index];
  }
  </code></pre>
  
  <p>My problem is creating a jobject.myCppVector so that I'll be able to use it from different function calls.</p>
  
  <p>I hope someone understands my ramblings</p>