// Automatically generated by StubsGenerator.java

#include "tdakernel_stub_jni.h"

JniStub::JniStub(JavaVM *_jvm, jobject _tdaKernel, bool _closeInDestructor)
{
  jvm = _jvm;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
    return;
  tdaKernel = env->NewGlobalRef(_tdaKernel);
  closeInDestructor = _closeInDestructor;
  // initializing method IDs...
  close_ID = NULL;
  exists_ID = NULL;
  open_ID = NULL;
  startSave_ID = NULL;
  cancelSave_ID = NULL;
  finishSave_ID = NULL;
  drop_ID = NULL;
  findClass_ID = NULL;
  getClassName_ID = NULL;
  createObject_ID = NULL;
  createClass_ID = NULL;
  deleteClass_ID = NULL;
  isClass_ID = NULL;
  isDirectSubClass_ID = NULL;
  deleteObject_ID = NULL;
  moveObject_ID = NULL;
  isTypeOf_ID = NULL;
  isKindOf_ID = NULL;
  createAttribute_ID = NULL;
  isDerivedClass_ID = NULL;
  findAttribute_ID = NULL;
  deleteAttribute_ID = NULL;
  getAttributeName_ID = NULL;
  getPrimitiveDataTypeName_ID = NULL;
  findPrimitiveDataType_ID = NULL;
  isPrimitiveDataType_ID = NULL;
  getIteratorForClasses_ID = NULL;
  getAttributeValue_ID = NULL;
  createAssociation_ID = NULL;
  getIteratorForDirectSubClasses_ID = NULL;
  getIteratorForAllClassObjects_ID = NULL;
  getIteratorForDirectAttributes_ID = NULL;
  getAttributeDomain_ID = NULL;
  deleteGeneralization_ID = NULL;
  createGeneralization_ID = NULL;
  excludeObjectFromClass_ID = NULL;
  getIteratorForAllAttributes_ID = NULL;
  includeObjectInClass_ID = NULL;
  getIteratorForDirectSuperClasses_ID = NULL;
  getIteratorForDirectClassObjects_ID = NULL;
  setAttributeValue_ID = NULL;
  deleteAttributeValue_ID = NULL;
  getIteratorForDirectLinguisticInstances_ID = NULL;
  getIteratorForDirectObjectClasses_ID = NULL;
  getIteratorForObjectsByAttributeValue_ID = NULL;
  getIteratorForAllOutgoingAssociationEnds_ID = NULL;
  getIteratorForDirectIngoingAssociationEnds_ID = NULL;
  getIteratorForAllLinguisticInstances_ID = NULL;
  getIteratorForDirectOutgoingAssociationEnds_ID = NULL;
  getIteratorForAllIngoingAssociationEnds_ID = NULL;
  resolveIterator_ID = NULL;
  getRoleName_ID = NULL;
  deleteLink_ID = NULL;
  createLink_ID = NULL;
  isLinguistic_ID = NULL;
  getAttributeType_ID = NULL;
  getTargetClass_ID = NULL;
  isAssociationEnd_ID = NULL;
  freeReference_ID = NULL;
  isAttribute_ID = NULL;
  getSourceClass_ID = NULL;
  linkExists_ID = NULL;
  isComposition_ID = NULL;
  freeIterator_ID = NULL;
  getLinguisticClassFor_ID = NULL;
  deleteAssociation_ID = NULL;
  createOrderedLink_ID = NULL;
  deserializeReference_ID = NULL;
  createDirectedAssociation_ID = NULL;
  isAdvancedAssociation_ID = NULL;
  resolveIteratorFirst_ID = NULL;
  callSpecificOperation_ID = NULL;
  getInverseAssociationEnd_ID = NULL;
  getLinkedObjectPosition_ID = NULL;
  getIteratorLength_ID = NULL;
  getIteratorForLinkedObjects_ID = NULL;
  createAdvancedAssociation_ID = NULL;
  getIteratorForLinguisticClasses_ID = NULL;
  findAssociationEnd_ID = NULL;
  serializeReference_ID = NULL;
  resolveIteratorNext_ID = NULL;
  jclass cls = env->GetObjectClass(tdaKernel);
  close_ID = env->GetMethodID(cls, "close", "()V");
  exists_ID = env->GetMethodID(cls, "exists", "(Ljava/lang/String;)Z");
  open_ID = env->GetMethodID(cls, "open", "(Ljava/lang/String;)Z");
  startSave_ID = env->GetMethodID(cls, "startSave", "()Z");
  cancelSave_ID = env->GetMethodID(cls, "cancelSave", "()Z");
  finishSave_ID = env->GetMethodID(cls, "finishSave", "()Z");
  drop_ID = env->GetMethodID(cls, "drop", "(Ljava/lang/String;)Z");
  findClass_ID = env->GetMethodID(cls, "findClass", "(Ljava/lang/String;)J");
  getClassName_ID = env->GetMethodID(cls, "getClassName", "(J)Ljava/lang/String;");
  createObject_ID = env->GetMethodID(cls, "createObject", "(J)J");
  createClass_ID = env->GetMethodID(cls, "createClass", "(Ljava/lang/String;)J");
  deleteClass_ID = env->GetMethodID(cls, "deleteClass", "(J)Z");
  isClass_ID = env->GetMethodID(cls, "isClass", "(J)Z");
  isDirectSubClass_ID = env->GetMethodID(cls, "isDirectSubClass", "(JJ)Z");
  deleteObject_ID = env->GetMethodID(cls, "deleteObject", "(J)Z");
  moveObject_ID = env->GetMethodID(cls, "moveObject", "(JJ)Z");
  isTypeOf_ID = env->GetMethodID(cls, "isTypeOf", "(JJ)Z");
  isKindOf_ID = env->GetMethodID(cls, "isKindOf", "(JJ)Z");
  createAttribute_ID = env->GetMethodID(cls, "createAttribute", "(JLjava/lang/String;J)J");
  isDerivedClass_ID = env->GetMethodID(cls, "isDerivedClass", "(JJ)Z");
  findAttribute_ID = env->GetMethodID(cls, "findAttribute", "(JLjava/lang/String;)J");
  deleteAttribute_ID = env->GetMethodID(cls, "deleteAttribute", "(J)Z");
  getAttributeName_ID = env->GetMethodID(cls, "getAttributeName", "(J)Ljava/lang/String;");
  getPrimitiveDataTypeName_ID = env->GetMethodID(cls, "getPrimitiveDataTypeName", "(J)Ljava/lang/String;");
  findPrimitiveDataType_ID = env->GetMethodID(cls, "findPrimitiveDataType", "(Ljava/lang/String;)J");
  isPrimitiveDataType_ID = env->GetMethodID(cls, "isPrimitiveDataType", "(J)Z");
  getIteratorForClasses_ID = env->GetMethodID(cls, "getIteratorForClasses", "()J");
  getAttributeValue_ID = env->GetMethodID(cls, "getAttributeValue", "(JJ)Ljava/lang/String;");
  createAssociation_ID = env->GetMethodID(cls, "createAssociation", "(JJLjava/lang/String;Ljava/lang/String;Z)J");
  getIteratorForDirectSubClasses_ID = env->GetMethodID(cls, "getIteratorForDirectSubClasses", "(J)J");
  getIteratorForAllClassObjects_ID = env->GetMethodID(cls, "getIteratorForAllClassObjects", "(J)J");
  getIteratorForDirectAttributes_ID = env->GetMethodID(cls, "getIteratorForDirectAttributes", "(J)J");
  getAttributeDomain_ID = env->GetMethodID(cls, "getAttributeDomain", "(J)J");
  deleteGeneralization_ID = env->GetMethodID(cls, "deleteGeneralization", "(JJ)Z");
  createGeneralization_ID = env->GetMethodID(cls, "createGeneralization", "(JJ)Z");
  excludeObjectFromClass_ID = env->GetMethodID(cls, "excludeObjectFromClass", "(JJ)Z");
  getIteratorForAllAttributes_ID = env->GetMethodID(cls, "getIteratorForAllAttributes", "(J)J");
  includeObjectInClass_ID = env->GetMethodID(cls, "includeObjectInClass", "(JJ)Z");
  getIteratorForDirectSuperClasses_ID = env->GetMethodID(cls, "getIteratorForDirectSuperClasses", "(J)J");
  getIteratorForDirectClassObjects_ID = env->GetMethodID(cls, "getIteratorForDirectClassObjects", "(J)J");
  setAttributeValue_ID = env->GetMethodID(cls, "setAttributeValue", "(JJLjava/lang/String;)Z");
  deleteAttributeValue_ID = env->GetMethodID(cls, "deleteAttributeValue", "(JJ)Z");
  getIteratorForDirectLinguisticInstances_ID = env->GetMethodID(cls, "getIteratorForDirectLinguisticInstances", "(J)J");
  getIteratorForDirectObjectClasses_ID = env->GetMethodID(cls, "getIteratorForDirectObjectClasses", "(J)J");
  getIteratorForObjectsByAttributeValue_ID = env->GetMethodID(cls, "getIteratorForObjectsByAttributeValue", "(JLjava/lang/String;)J");
  getIteratorForAllOutgoingAssociationEnds_ID = env->GetMethodID(cls, "getIteratorForAllOutgoingAssociationEnds", "(J)J");
  getIteratorForDirectIngoingAssociationEnds_ID = env->GetMethodID(cls, "getIteratorForDirectIngoingAssociationEnds", "(J)J");
  getIteratorForAllLinguisticInstances_ID = env->GetMethodID(cls, "getIteratorForAllLinguisticInstances", "(J)J");
  getIteratorForDirectOutgoingAssociationEnds_ID = env->GetMethodID(cls, "getIteratorForDirectOutgoingAssociationEnds", "(J)J");
  getIteratorForAllIngoingAssociationEnds_ID = env->GetMethodID(cls, "getIteratorForAllIngoingAssociationEnds", "(J)J");
  resolveIterator_ID = env->GetMethodID(cls, "resolveIterator", "(JI)J");
  getRoleName_ID = env->GetMethodID(cls, "getRoleName", "(J)Ljava/lang/String;");
  deleteLink_ID = env->GetMethodID(cls, "deleteLink", "(JJJ)Z");
  createLink_ID = env->GetMethodID(cls, "createLink", "(JJJ)Z");
  isLinguistic_ID = env->GetMethodID(cls, "isLinguistic", "(J)Z");
  getAttributeType_ID = env->GetMethodID(cls, "getAttributeType", "(J)J");
  getTargetClass_ID = env->GetMethodID(cls, "getTargetClass", "(J)J");
  isAssociationEnd_ID = env->GetMethodID(cls, "isAssociationEnd", "(J)Z");
  freeReference_ID = env->GetMethodID(cls, "freeReference", "(J)V");
  isAttribute_ID = env->GetMethodID(cls, "isAttribute", "(J)Z");
  getSourceClass_ID = env->GetMethodID(cls, "getSourceClass", "(J)J");
  linkExists_ID = env->GetMethodID(cls, "linkExists", "(JJJ)Z");
  isComposition_ID = env->GetMethodID(cls, "isComposition", "(J)Z");
  freeIterator_ID = env->GetMethodID(cls, "freeIterator", "(J)V");
  getLinguisticClassFor_ID = env->GetMethodID(cls, "getLinguisticClassFor", "(J)J");
  deleteAssociation_ID = env->GetMethodID(cls, "deleteAssociation", "(J)Z");
  createOrderedLink_ID = env->GetMethodID(cls, "createOrderedLink", "(JJJI)Z");
  deserializeReference_ID = env->GetMethodID(cls, "deserializeReference", "(Ljava/lang/String;)J");
  createDirectedAssociation_ID = env->GetMethodID(cls, "createDirectedAssociation", "(JJLjava/lang/String;Z)J");
  isAdvancedAssociation_ID = env->GetMethodID(cls, "isAdvancedAssociation", "(J)Z");
  resolveIteratorFirst_ID = env->GetMethodID(cls, "resolveIteratorFirst", "(J)J");
  callSpecificOperation_ID = env->GetMethodID(cls, "callSpecificOperation", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;");
  getInverseAssociationEnd_ID = env->GetMethodID(cls, "getInverseAssociationEnd", "(J)J");
  getLinkedObjectPosition_ID = env->GetMethodID(cls, "getLinkedObjectPosition", "(JJJ)I");
  getIteratorLength_ID = env->GetMethodID(cls, "getIteratorLength", "(J)I");
  getIteratorForLinkedObjects_ID = env->GetMethodID(cls, "getIteratorForLinkedObjects", "(JJ)J");
  createAdvancedAssociation_ID = env->GetMethodID(cls, "createAdvancedAssociation", "(Ljava/lang/String;ZZ)J");
  getIteratorForLinguisticClasses_ID = env->GetMethodID(cls, "getIteratorForLinguisticClasses", "()J");
  findAssociationEnd_ID = env->GetMethodID(cls, "findAssociationEnd", "(JLjava/lang/String;)J");
  serializeReference_ID = env->GetMethodID(cls, "serializeReference", "(J)Ljava/lang/String;");
  resolveIteratorNext_ID = env->GetMethodID(cls, "resolveIteratorNext", "(J)J");
}
void JniStub::close()
{
  if (close_ID == NULL)
    return;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return;
  env->CallVoidMethod(tdaKernel, close_ID);
}

bool JniStub::exists(const char* _param1)
{
  if (exists_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  jstring param1 = (_param1==NULL)?NULL:env->NewStringUTF(_param1);
  bool retVal = env->CallBooleanMethod(tdaKernel, exists_ID, param1);
  if (param1!=NULL)
    env->DeleteLocalRef(param1);
  return retVal;
}

bool JniStub::open(const char* _param1)
{
  if (open_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  jstring param1 = (_param1==NULL)?NULL:env->NewStringUTF(_param1);
  bool retVal = env->CallBooleanMethod(tdaKernel, open_ID, param1);
  if (param1!=NULL)
    env->DeleteLocalRef(param1);
  return retVal;
}

bool JniStub::startSave()
{
  if (startSave_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, startSave_ID);
  return retVal;
}

bool JniStub::cancelSave()
{
  if (cancelSave_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, cancelSave_ID);
  return retVal;
}

bool JniStub::finishSave()
{
  if (finishSave_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, finishSave_ID);
  return retVal;
}

bool JniStub::drop(const char* _param1)
{
  if (drop_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  jstring param1 = (_param1==NULL)?NULL:env->NewStringUTF(_param1);
  bool retVal = env->CallBooleanMethod(tdaKernel, drop_ID, param1);
  if (param1!=NULL)
    env->DeleteLocalRef(param1);
  return retVal;
}

__int64 JniStub::findClass(const char* _param1)
{
  if (findClass_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  jstring param1 = (_param1==NULL)?NULL:env->NewStringUTF(_param1);
  __int64 retVal = env->CallLongMethod(tdaKernel, findClass_ID, param1);
  if (param1!=NULL)
    env->DeleteLocalRef(param1);
  return retVal;
}

const char* JniStub::getClassName(__int64 param1)
{
  if (getClassName_ID == NULL)
    return NULL;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return NULL;
  jstring s = (jstring)env->CallObjectMethod(tdaKernel, getClassName_ID, param1);
  if (s == NULL) {
    return NULL;
  }
  else {
    const char* modifiedUTF = env->GetStringUTFChars(s, NULL);
    const char* retVal = TDA_CreateReturnString(modifiedUTF);
    env->ReleaseStringUTFChars(s, modifiedUTF);
    return retVal;
  }
}

__int64 JniStub::createObject(__int64 param1)
{
  if (createObject_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, createObject_ID, param1);
  return retVal;
}

__int64 JniStub::createClass(const char* _param1)
{
  if (createClass_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  jstring param1 = (_param1==NULL)?NULL:env->NewStringUTF(_param1);
  __int64 retVal = env->CallLongMethod(tdaKernel, createClass_ID, param1);
  if (param1!=NULL)
    env->DeleteLocalRef(param1);
  return retVal;
}

bool JniStub::deleteClass(__int64 param1)
{
  if (deleteClass_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, deleteClass_ID, param1);
  return retVal;
}

bool JniStub::isClass(__int64 param1)
{
  if (isClass_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, isClass_ID, param1);
  return retVal;
}

bool JniStub::isDirectSubClass(__int64 param1, __int64 param2)
{
  if (isDirectSubClass_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, isDirectSubClass_ID, param1, param2);
  return retVal;
}

bool JniStub::deleteObject(__int64 param1)
{
  if (deleteObject_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, deleteObject_ID, param1);
  return retVal;
}

bool JniStub::moveObject(__int64 param1, __int64 param2)
{
  if (moveObject_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, moveObject_ID, param1, param2);
  return retVal;
}

bool JniStub::isTypeOf(__int64 param1, __int64 param2)
{
  if (isTypeOf_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, isTypeOf_ID, param1, param2);
  return retVal;
}

bool JniStub::isKindOf(__int64 param1, __int64 param2)
{
  if (isKindOf_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, isKindOf_ID, param1, param2);
  return retVal;
}

__int64 JniStub::createAttribute(__int64 param1, const char* _param2, __int64 param3)
{
  if (createAttribute_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  jstring param2 = (_param2==NULL)?NULL:env->NewStringUTF(_param2);
  __int64 retVal = env->CallLongMethod(tdaKernel, createAttribute_ID, param1, param2, param3);
  if (param2!=NULL)
    env->DeleteLocalRef(param2);
  return retVal;
}

bool JniStub::isDerivedClass(__int64 param1, __int64 param2)
{
  if (isDerivedClass_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, isDerivedClass_ID, param1, param2);
  return retVal;
}

__int64 JniStub::findAttribute(__int64 param1, const char* _param2)
{
  if (findAttribute_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  jstring param2 = (_param2==NULL)?NULL:env->NewStringUTF(_param2);
  __int64 retVal = env->CallLongMethod(tdaKernel, findAttribute_ID, param1, param2);
  if (param2!=NULL)
    env->DeleteLocalRef(param2);
  return retVal;
}

bool JniStub::deleteAttribute(__int64 param1)
{
  if (deleteAttribute_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, deleteAttribute_ID, param1);
  return retVal;
}

const char* JniStub::getAttributeName(__int64 param1)
{
  if (getAttributeName_ID == NULL)
    return NULL;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return NULL;
  jstring s = (jstring)env->CallObjectMethod(tdaKernel, getAttributeName_ID, param1);
  if (s == NULL) {
    return NULL;
  }
  else {
    const char* modifiedUTF = env->GetStringUTFChars(s, NULL);
    const char* retVal = TDA_CreateReturnString(modifiedUTF);
    env->ReleaseStringUTFChars(s, modifiedUTF);
    return retVal;
  }
}

const char* JniStub::getPrimitiveDataTypeName(__int64 param1)
{
  if (getPrimitiveDataTypeName_ID == NULL)
    return NULL;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return NULL;
  jstring s = (jstring)env->CallObjectMethod(tdaKernel, getPrimitiveDataTypeName_ID, param1);
  if (s == NULL) {
    return NULL;
  }
  else {
    const char* modifiedUTF = env->GetStringUTFChars(s, NULL);
    const char* retVal = TDA_CreateReturnString(modifiedUTF);
    env->ReleaseStringUTFChars(s, modifiedUTF);
    return retVal;
  }
}

__int64 JniStub::findPrimitiveDataType(const char* _param1)
{
  if (findPrimitiveDataType_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  jstring param1 = (_param1==NULL)?NULL:env->NewStringUTF(_param1);
  __int64 retVal = env->CallLongMethod(tdaKernel, findPrimitiveDataType_ID, param1);
  if (param1!=NULL)
    env->DeleteLocalRef(param1);
  return retVal;
}

bool JniStub::isPrimitiveDataType(__int64 param1)
{
  if (isPrimitiveDataType_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, isPrimitiveDataType_ID, param1);
  return retVal;
}

__int64 JniStub::getIteratorForClasses()
{
  if (getIteratorForClasses_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForClasses_ID);
  return retVal;
}

const char* JniStub::getAttributeValue(__int64 param1, __int64 param2)
{
  if (getAttributeValue_ID == NULL)
    return NULL;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return NULL;
  jstring s = (jstring)env->CallObjectMethod(tdaKernel, getAttributeValue_ID, param1, param2);
  if (s == NULL) {
    return NULL;
  }
  else {
    const char* modifiedUTF = env->GetStringUTFChars(s, NULL);
    const char* retVal = TDA_CreateReturnString(modifiedUTF);
    env->ReleaseStringUTFChars(s, modifiedUTF);
    return retVal;
  }
}

__int64 JniStub::createAssociation(__int64 param1, __int64 param2, const char* _param3, const char* _param4, bool param5)
{
  if (createAssociation_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  jstring param3 = (_param3==NULL)?NULL:env->NewStringUTF(_param3);
  jstring param4 = (_param4==NULL)?NULL:env->NewStringUTF(_param4);
  __int64 retVal = env->CallLongMethod(tdaKernel, createAssociation_ID, param1, param2, param3, param4, param5);
  if (param3!=NULL)
    env->DeleteLocalRef(param3);
  if (param4!=NULL)
    env->DeleteLocalRef(param4);
  return retVal;
}

__int64 JniStub::getIteratorForDirectSubClasses(__int64 param1)
{
  if (getIteratorForDirectSubClasses_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForDirectSubClasses_ID, param1);
  return retVal;
}

__int64 JniStub::getIteratorForAllClassObjects(__int64 param1)
{
  if (getIteratorForAllClassObjects_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForAllClassObjects_ID, param1);
  return retVal;
}

__int64 JniStub::getIteratorForDirectAttributes(__int64 param1)
{
  if (getIteratorForDirectAttributes_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForDirectAttributes_ID, param1);
  return retVal;
}

__int64 JniStub::getAttributeDomain(__int64 param1)
{
  if (getAttributeDomain_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getAttributeDomain_ID, param1);
  return retVal;
}

bool JniStub::deleteGeneralization(__int64 param1, __int64 param2)
{
  if (deleteGeneralization_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, deleteGeneralization_ID, param1, param2);
  return retVal;
}

bool JniStub::createGeneralization(__int64 param1, __int64 param2)
{
  if (createGeneralization_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, createGeneralization_ID, param1, param2);
  return retVal;
}

bool JniStub::excludeObjectFromClass(__int64 param1, __int64 param2)
{
  if (excludeObjectFromClass_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, excludeObjectFromClass_ID, param1, param2);
  return retVal;
}

__int64 JniStub::getIteratorForAllAttributes(__int64 param1)
{
  if (getIteratorForAllAttributes_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForAllAttributes_ID, param1);
  return retVal;
}

bool JniStub::includeObjectInClass(__int64 param1, __int64 param2)
{
  if (includeObjectInClass_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, includeObjectInClass_ID, param1, param2);
  return retVal;
}

__int64 JniStub::getIteratorForDirectSuperClasses(__int64 param1)
{
  if (getIteratorForDirectSuperClasses_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForDirectSuperClasses_ID, param1);
  return retVal;
}

__int64 JniStub::getIteratorForDirectClassObjects(__int64 param1)
{
  if (getIteratorForDirectClassObjects_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForDirectClassObjects_ID, param1);
  return retVal;
}

bool JniStub::setAttributeValue(__int64 param1, __int64 param2, const char* _param3)
{
  if (setAttributeValue_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  jstring param3 = (_param3==NULL)?NULL:env->NewStringUTF(_param3);
  bool retVal = env->CallBooleanMethod(tdaKernel, setAttributeValue_ID, param1, param2, param3);
  if (param3!=NULL)
    env->DeleteLocalRef(param3);
  return retVal;
}

bool JniStub::deleteAttributeValue(__int64 param1, __int64 param2)
{
  if (deleteAttributeValue_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, deleteAttributeValue_ID, param1, param2);
  return retVal;
}

__int64 JniStub::getIteratorForDirectLinguisticInstances(__int64 param1)
{
  if (getIteratorForDirectLinguisticInstances_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForDirectLinguisticInstances_ID, param1);
  return retVal;
}

__int64 JniStub::getIteratorForDirectObjectClasses(__int64 param1)
{
  if (getIteratorForDirectObjectClasses_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForDirectObjectClasses_ID, param1);
  return retVal;
}

__int64 JniStub::getIteratorForObjectsByAttributeValue(__int64 param1, const char* _param2)
{
  if (getIteratorForObjectsByAttributeValue_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  jstring param2 = (_param2==NULL)?NULL:env->NewStringUTF(_param2);
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForObjectsByAttributeValue_ID, param1, param2);
  if (param2!=NULL)
    env->DeleteLocalRef(param2);
  return retVal;
}

__int64 JniStub::getIteratorForAllOutgoingAssociationEnds(__int64 param1)
{
  if (getIteratorForAllOutgoingAssociationEnds_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForAllOutgoingAssociationEnds_ID, param1);
  return retVal;
}

__int64 JniStub::getIteratorForDirectIngoingAssociationEnds(__int64 param1)
{
  if (getIteratorForDirectIngoingAssociationEnds_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForDirectIngoingAssociationEnds_ID, param1);
  return retVal;
}

__int64 JniStub::getIteratorForAllLinguisticInstances(__int64 param1)
{
  if (getIteratorForAllLinguisticInstances_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForAllLinguisticInstances_ID, param1);
  return retVal;
}

__int64 JniStub::getIteratorForDirectOutgoingAssociationEnds(__int64 param1)
{
  if (getIteratorForDirectOutgoingAssociationEnds_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForDirectOutgoingAssociationEnds_ID, param1);
  return retVal;
}

__int64 JniStub::getIteratorForAllIngoingAssociationEnds(__int64 param1)
{
  if (getIteratorForAllIngoingAssociationEnds_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForAllIngoingAssociationEnds_ID, param1);
  return retVal;
}

__int64 JniStub::resolveIterator(__int64 param1, int param2)
{
  if (resolveIterator_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, resolveIterator_ID, param1, param2);
  return retVal;
}

const char* JniStub::getRoleName(__int64 param1)
{
  if (getRoleName_ID == NULL)
    return NULL;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return NULL;
  jstring s = (jstring)env->CallObjectMethod(tdaKernel, getRoleName_ID, param1);
  if (s == NULL) {
    return NULL;
  }
  else {
    const char* modifiedUTF = env->GetStringUTFChars(s, NULL);
    const char* retVal = TDA_CreateReturnString(modifiedUTF);
    env->ReleaseStringUTFChars(s, modifiedUTF);
    return retVal;
  }
}

bool JniStub::deleteLink(__int64 param1, __int64 param2, __int64 param3)
{
  if (deleteLink_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, deleteLink_ID, param1, param2, param3);
  return retVal;
}

bool JniStub::createLink(__int64 param1, __int64 param2, __int64 param3)
{
  if (createLink_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, createLink_ID, param1, param2, param3);
  return retVal;
}

bool JniStub::isLinguistic(__int64 param1)
{
  if (isLinguistic_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, isLinguistic_ID, param1);
  return retVal;
}

__int64 JniStub::getAttributeType(__int64 param1)
{
  if (getAttributeType_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getAttributeType_ID, param1);
  return retVal;
}

__int64 JniStub::getTargetClass(__int64 param1)
{
  if (getTargetClass_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getTargetClass_ID, param1);
  return retVal;
}

bool JniStub::isAssociationEnd(__int64 param1)
{
  if (isAssociationEnd_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, isAssociationEnd_ID, param1);
  return retVal;
}

void JniStub::freeReference(__int64 param1)
{
  if (freeReference_ID == NULL)
    return;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return;
  env->CallVoidMethod(tdaKernel, freeReference_ID, param1);
}

bool JniStub::isAttribute(__int64 param1)
{
  if (isAttribute_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, isAttribute_ID, param1);
  return retVal;
}

__int64 JniStub::getSourceClass(__int64 param1)
{
  if (getSourceClass_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getSourceClass_ID, param1);
  return retVal;
}

bool JniStub::linkExists(__int64 param1, __int64 param2, __int64 param3)
{
  if (linkExists_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, linkExists_ID, param1, param2, param3);
  return retVal;
}

bool JniStub::isComposition(__int64 param1)
{
  if (isComposition_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, isComposition_ID, param1);
  return retVal;
}

void JniStub::freeIterator(__int64 param1)
{
  if (freeIterator_ID == NULL)
    return;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return;
  env->CallVoidMethod(tdaKernel, freeIterator_ID, param1);
}

__int64 JniStub::getLinguisticClassFor(__int64 param1)
{
  if (getLinguisticClassFor_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getLinguisticClassFor_ID, param1);
  return retVal;
}

bool JniStub::deleteAssociation(__int64 param1)
{
  if (deleteAssociation_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, deleteAssociation_ID, param1);
  return retVal;
}

bool JniStub::createOrderedLink(__int64 param1, __int64 param2, __int64 param3, int param4)
{
  if (createOrderedLink_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, createOrderedLink_ID, param1, param2, param3, param4);
  return retVal;
}

__int64 JniStub::deserializeReference(const char* _param1)
{
  if (deserializeReference_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  jstring param1 = (_param1==NULL)?NULL:env->NewStringUTF(_param1);
  __int64 retVal = env->CallLongMethod(tdaKernel, deserializeReference_ID, param1);
  if (param1!=NULL)
    env->DeleteLocalRef(param1);
  return retVal;
}

__int64 JniStub::createDirectedAssociation(__int64 param1, __int64 param2, const char* _param3, bool param4)
{
  if (createDirectedAssociation_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  jstring param3 = (_param3==NULL)?NULL:env->NewStringUTF(_param3);
  __int64 retVal = env->CallLongMethod(tdaKernel, createDirectedAssociation_ID, param1, param2, param3, param4);
  if (param3!=NULL)
    env->DeleteLocalRef(param3);
  return retVal;
}

bool JniStub::isAdvancedAssociation(__int64 param1)
{
  if (isAdvancedAssociation_ID == NULL)
    return false;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return false;
  bool retVal = env->CallBooleanMethod(tdaKernel, isAdvancedAssociation_ID, param1);
  return retVal;
}

__int64 JniStub::resolveIteratorFirst(__int64 param1)
{
  if (resolveIteratorFirst_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, resolveIteratorFirst_ID, param1);
  return retVal;
}

const char* JniStub::callSpecificOperation(const char* _param1, const char* _param2)
{
  if (callSpecificOperation_ID == NULL)
    return NULL;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return NULL;
  jstring param1 = (_param1==NULL)?NULL:env->NewStringUTF(_param1);
  jstring param2 = (_param2==NULL)?NULL:env->NewStringUTF(_param2);
  jstring s = (jstring)env->CallObjectMethod(tdaKernel, callSpecificOperation_ID, param1, param2);
  if (s == NULL) {
  if (param1!=NULL)
    env->DeleteLocalRef(param1);
  if (param2!=NULL)
    env->DeleteLocalRef(param2);
    return NULL;
  }
  else {
    const char* modifiedUTF = env->GetStringUTFChars(s, NULL);
    const char* retVal = TDA_CreateReturnString(modifiedUTF);
    env->ReleaseStringUTFChars(s, modifiedUTF);
  if (param1!=NULL)
    env->DeleteLocalRef(param1);
  if (param2!=NULL)
    env->DeleteLocalRef(param2);
    return retVal;
  }
}

__int64 JniStub::getInverseAssociationEnd(__int64 param1)
{
  if (getInverseAssociationEnd_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getInverseAssociationEnd_ID, param1);
  return retVal;
}

int JniStub::getLinkedObjectPosition(__int64 param1, __int64 param2, __int64 param3)
{
  if (getLinkedObjectPosition_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  int retVal = env->CallIntMethod(tdaKernel, getLinkedObjectPosition_ID, param1, param2, param3);
  return retVal;
}

int JniStub::getIteratorLength(__int64 param1)
{
  if (getIteratorLength_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  int retVal = env->CallIntMethod(tdaKernel, getIteratorLength_ID, param1);
  return retVal;
}

__int64 JniStub::getIteratorForLinkedObjects(__int64 param1, __int64 param2)
{
  if (getIteratorForLinkedObjects_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForLinkedObjects_ID, param1, param2);
  return retVal;
}

__int64 JniStub::createAdvancedAssociation(const char* _param1, bool param2, bool param3)
{
  if (createAdvancedAssociation_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  jstring param1 = (_param1==NULL)?NULL:env->NewStringUTF(_param1);
  __int64 retVal = env->CallLongMethod(tdaKernel, createAdvancedAssociation_ID, param1, param2, param3);
  if (param1!=NULL)
    env->DeleteLocalRef(param1);
  return retVal;
}

__int64 JniStub::getIteratorForLinguisticClasses()
{
  if (getIteratorForLinguisticClasses_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, getIteratorForLinguisticClasses_ID);
  return retVal;
}

__int64 JniStub::findAssociationEnd(__int64 param1, const char* _param2)
{
  if (findAssociationEnd_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  jstring param2 = (_param2==NULL)?NULL:env->NewStringUTF(_param2);
  __int64 retVal = env->CallLongMethod(tdaKernel, findAssociationEnd_ID, param1, param2);
  if (param2!=NULL)
    env->DeleteLocalRef(param2);
  return retVal;
}

const char* JniStub::serializeReference(__int64 param1)
{
  if (serializeReference_ID == NULL)
    return NULL;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return NULL;
  jstring s = (jstring)env->CallObjectMethod(tdaKernel, serializeReference_ID, param1);
  if (s == NULL) {
    return NULL;
  }
  else {
    const char* modifiedUTF = env->GetStringUTFChars(s, NULL);
    const char* retVal = TDA_CreateReturnString(modifiedUTF);
    env->ReleaseStringUTFChars(s, modifiedUTF);
    return retVal;
  }
}

__int64 JniStub::resolveIteratorNext(__int64 param1)
{
  if (resolveIteratorNext_ID == NULL)
    return 0;
  JNIEnv *env = NULL;
  jint res = jvm->AttachCurrentThread((void**)&env, NULL);
  if ((res<0) || (env==NULL))
     return 0;
  __int64 retVal = env->CallLongMethod(tdaKernel, resolveIteratorNext_ID, param1);
  return retVal;
}

JniStub::~JniStub()
{
  if (tdaKernel != NULL) {
  if (closeInDestructor)
    close();
    JNIEnv *env = NULL;
    jint res = jvm->AttachCurrentThread((void**)&env, NULL);
    if ((res>=0) && (env!=NULL))
      env->DeleteGlobalRef(tdaKernel);
  }
}
