def createdJVMs(self) -> Tuple['_JVM', ...]: njvm = jni.new(jni.jsize) err = self._jvm.JNI.GetCreatedJavaVMs(None, 0, njvm) if err != jni.JNI_OK: raise jni.JNIException(err, info="JNI_GetCreatedJavaVMs") pjvm = jni.new_array(jni.POINTER(jni.JavaVM), njvm[0]) err = self._jvm.JNI.GetCreatedJavaVMs(pjvm, len(pjvm), njvm) if err != jni.JNI_OK: raise jni.JNIException(err, info="JNI_GetCreatedJavaVMs") jvms = [] for i in range(njvm[0]): jvm = _JVM() jvm.JNI = self._jvm.JNI jvm.jnijvm = pjvm[0][i] jvms.append(jvm) return tuple(jvms)
def getDouble(self, idx: int) -> float: with self.jvm as (jvm, jenv): elem = jni.new(jni.jdouble) jenv.GetDoubleArrayRegion(self._jobj, idx, 1, elem) return elem[0]
def getFloat(self, idx: int) -> float: with self.jvm as (jvm, jenv): elem = jni.new(jni.jfloat) jenv.GetFloatArrayRegion(self._jobj, idx, 1, elem) return elem[0]
def getLong(self, idx: int) -> int: with self.jvm as (jvm, jenv): elem = jni.new(jni.jlong) jenv.GetLongArrayRegion(self._jobj, idx, 1, elem) return elem[0]
def getShort(self, idx: int) -> int: with self.jvm as (jvm, jenv): elem = jni.new(jni.jshort) jenv.GetShortArrayRegion(self._jobj, idx, 1, elem) return elem[0]
def getByte(self, idx: int) -> int: with self.jvm as (jvm, jenv): elem = jni.new(jni.jbyte) jenv.GetByteArrayRegion(self._jobj, idx, 1, elem) return elem[0]
def getBoolean(self, idx: int) -> bool: with self.jvm as (jvm, jenv): elem = jni.new(jni.jboolean) jenv.GetBooleanArrayRegion(self._jobj, idx, 1, elem) return bool(elem[0])
def getInt(self, idx: int) -> int: """???.""" with self.jvm as (jvm, jenv): elem = jni.new(jni.jint) jenv.GetIntArrayRegion(self._jobj, idx, 1, elem) return elem[0]