Exemplo n.º 1
0
 public Java Connect()
 {
     if (java == null)
     {
         java = new Java(this);
     }
     return(java);
 }
Exemplo n.º 2
0
 private void init_java_vm_intron()
 {
     jvm           = null;
     java          = null;
     env           = null;
     hJvmDll       = 0;
     hNecessaryDll = null;
     jvm_path      = JavaBasicConst.JVM_PATH;
 }
Exemplo n.º 3
0
 public JavaArray(char[] _arr)
     : base(Java.GetEnvironment(), JavaClass.charclass, 0)
 {
     id = env.NewCharArray(_arr.Length);
     if (id <= 0)
     {
         throw new Exception("fail to create an array of char");
     }
     env.SetCharArrayRegion(id, 0, _arr.Length, _arr);
 }
Exemplo n.º 4
0
 public JavaArray(byte[] _arr)
     : base(Java.GetEnvironment(), JavaClass.byteclass, 0)
 {
     id = env.NewByteArray(_arr.Length);
     if (id <= 0)
     {
         throw new Exception("fail to create an array of byte");
     }
     env.SetByteArrayRegion(id, 0, _arr.Length, _arr);
 }
Exemplo n.º 5
0
 public JavaArray(short[] _arr)
     : base(Java.GetEnvironment(), JavaClass.shortclass, 0)
 {
     id = env.NewShortArray(_arr.Length);
     if (id <= 0)
     {
         throw new Exception("fail to create an array of short");
     }
     env.SetShortArrayRegion(id, 0, _arr.Length, _arr);
 }
Exemplo n.º 6
0
 public JavaArray(long[] _arr)
     : base(Java.GetEnvironment(), JavaClass.longclass, 0)
 {
     id = env.NewLongArray(_arr.Length);
     if (id <= 0)
     {
         throw new Exception("fail to create an array of long");
     }
     env.SetLongArrayRegion(id, 0, _arr.Length, _arr);
 }
Exemplo n.º 7
0
 public JavaArray(double[] _arr)
     : base(Java.GetEnvironment(), JavaClass.intclass, 0)
 {
     id = env.NewDoubleArray(_arr.Length);
     if (id <= 0)
     {
         throw new Exception("fail to create an array of double");
     }
     env.SetDoubleArrayRegion(id, 0, _arr.Length, _arr);
 }
Exemplo n.º 8
0
 public JavaArray(JavaClass _cls, JavaConstructor _constructor, JavaObject[] _arr)
     : base(Java.GetEnvironment(), _cls, 0)
 {
     id = env.NewObjectArray(_arr.Length, _cls.GetID(), _constructor.GetID());
     if (id <= 0)
     {
         throw new Exception("fail to create an array of object[" + klass.GetClassFullName() + "]");
     }
     for (int i = 0; i < _arr.Length; i++)
     {
         env.SetObjectArrayElement(id, i, _arr[i].GetID());
     }
 }
Exemplo n.º 9
0
        public JavaArray(string[] _arr)
            : base(Java.GetEnvironment(), null, 0)
        {
            klass = new JavaClass(env, "java.lang.String");
            JavaConstructor constructor = klass.GetConstructor();

            id = env.NewObjectArray(_arr.Length, klass.GetID(), constructor.GetID());
            if (id <= 0)
            {
                throw new Exception("fail to create an array of object[" + klass.GetClassFullName() + "]");
            }
            for (int i = 0; i < _arr.Length; i++)
            {
                int strtmpid = env.NewStringUTF(_arr[i]);
                env.SetObjectArrayElement(id, i, strtmpid);
                env.DeleteLocalRef(strtmpid);
            }
        }
Exemplo n.º 10
0
 private JavaClass(string _name)
 {
     env = Java.GetEnvironment(); name = _name; id = -1;
 }