| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
package org.jpype.manager; |
| 17 |
|
| 18 |
import java.lang.reflect.Executable; |
| 19 |
import java.lang.reflect.Method; |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
public class ClassDescriptor |
| 28 |
{ |
| 29 |
|
| 30 |
public Class<?> cls; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
public long classPtr; |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
public long constructorDispatch; |
| 39 |
public long[] constructors; |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
public long[] methodDispatch; |
| 44 |
public Executable[] methodIndex; |
| 45 |
public long[] methods; |
| 46 |
public int methodCounter = 0; |
| 47 |
public long[] fields; |
| 48 |
public long anonymous; |
| 49 |
public int functional_interface_parameter_count; |
| 50 |
|
| 51 |
ClassDescriptor(Class cls, long classPtr, Method method) |
| 52 |
{ |
| 53 |
this.cls = cls; |
| 54 |
this.classPtr = classPtr; |
| 55 |
if (this.classPtr == 0) |
| 56 |
throw new NullPointerException("Class pointer is null for " + cls); |
| 57 |
if (method != null) |
| 58 |
functional_interface_parameter_count = method.getParameterCount(); |
| 59 |
else |
| 60 |
functional_interface_parameter_count = -1; |
| 61 |
} |
| 62 |
|
| 63 |
long getMethod(Method requestedMethod) |
| 64 |
{ |
| 65 |
for (int i = 0; i < methods.length; ++i) |
| 66 |
if (this.methodIndex[i].equals(requestedMethod)) |
| 67 |
return this.methods[i]; |
| 68 |
return 0; |
| 69 |
|
| 70 |
} |
| 71 |
} |