-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathJITSignature.java
More file actions
77 lines (63 loc) · 2.54 KB
/
JITSignature.java
File metadata and controls
77 lines (63 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package org.python.modules.jffi;
import com.kenai.jffi.CallingConvention;
import java.util.Arrays;
public final class JITSignature {
private final NativeType resultType;
private final NativeType[] parameterTypes;
private final boolean hasResultConverter;
private final boolean[] hasParameterConverter;
private final CallingConvention convention;
private final boolean ignoreError;
public JITSignature(NativeType resultType, NativeType[] parameterTypes,
boolean hasResultConverter, boolean[] hasParameterConverter,
CallingConvention convention, boolean ignoreError) {
this.resultType = resultType;
this.parameterTypes = (NativeType[]) parameterTypes.clone();
this.convention = convention;
this.ignoreError = ignoreError;
this.hasResultConverter = hasResultConverter;
this.hasParameterConverter = (boolean[]) hasParameterConverter.clone();
}
@Override
public boolean equals(Object o) {
if (o == null || !o.getClass().equals(getClass())) {
return false;
}
JITSignature rhs = (JITSignature) o;
return resultType.equals(rhs.resultType) && convention.equals(rhs.convention)
&& ignoreError == rhs.ignoreError
&& Arrays.equals(parameterTypes, rhs.parameterTypes)
&& hasResultConverter == rhs.hasResultConverter
&& Arrays.equals(hasParameterConverter, rhs.hasParameterConverter);
}
@Override
public int hashCode() {
return resultType.hashCode()
^ convention.hashCode()
^ Boolean.valueOf(ignoreError).hashCode()
^ Arrays.hashCode(parameterTypes)
^ Boolean.valueOf(hasResultConverter).hashCode()
^ Arrays.hashCode(hasParameterConverter);
}
public final NativeType getResultType() {
return resultType;
}
public final NativeType getParameterType(int parameterIndex) {
return parameterTypes[parameterIndex];
}
public final CallingConvention getCallingConvention() {
return convention;
}
public final int getParameterCount() {
return parameterTypes.length;
}
public final boolean hasResultConverter() {
return hasResultConverter;
}
public final boolean hasParameterConverter(int parameterIndex) {
return hasParameterConverter[parameterIndex];
}
public boolean isIgnoreError() {
return ignoreError;
}
}