-
Notifications
You must be signed in to change notification settings - Fork 13
/
JavaEnum.swift
184 lines (129 loc) · 7.82 KB
/
JavaEnum.swift
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/// generated by: genswift.java 'java/lang|java/util|java/sql|java/awt|javax/swing' ///
/// class java.lang.Enum ///
open class JavaEnum: JavaObject, /* interface java.lang.Comparable */ UnavailableProtocol {
public convenience init?( casting object: JavaObject, _ file: StaticString = #file, _ line: Int = #line ) {
self.init( javaObject: nil )
object.withJavaObject {
self.javaObject = $0
}
}
private static var JavaEnumJNIClass: jclass?
/// private final java.lang.String java.lang.Enum.name
/// private final int java.lang.Enum.ordinal
/// protected java.lang.Enum(java.lang.String,int)
private static var new_MethodID_1: jmethodID?
public convenience init( name: String?, ordinal: Int ) {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 2 )
__args[0] = JNIType.toJava( value: name, locals: &__locals )
__args[1] = jvalue( i: jint(ordinal) )
let __object = JNIMethod.NewObject( className: "java/lang/Enum", classCache: &JavaEnum.JavaEnumJNIClass, methodSig: "(Ljava/lang/String;I)V", methodCache: &JavaEnum.new_MethodID_1, args: &__args, locals: &__locals )
self.init( javaObject: __object )
JNI.DeleteLocalRef( __object )
}
public convenience init( _ _name: String?, _ _ordinal: Int ) {
self.init( name: _name, ordinal: _ordinal )
}
/// public static java.lang.Enum java.lang.Enum.valueOf(java.lang.Class,java.lang.String)
private static var valueOf_MethodID_2: jmethodID?
open class func valueOf( enumType: JavaClass?, name: String? ) -> JavaEnum! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 2 )
__args[0] = JNIType.toJava( value: enumType, locals: &__locals )
__args[1] = JNIType.toJava( value: name, locals: &__locals )
let __return = JNIMethod.CallStaticObjectMethod( className: "java/lang/Enum", classCache: &JavaEnumJNIClass, methodName: "valueOf", methodSig: "(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;", methodCache: &valueOf_MethodID_2, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
return __return != nil ? JavaEnum( javaObject: __return ) : nil
}
open class func valueOf( _ _enumType: JavaClass?, _ _name: String? ) -> JavaEnum! {
return valueOf( enumType: _enumType, name: _name )
}
/// protected final java.lang.Object java.lang.Enum.clone() throws java.lang.CloneNotSupportedException
private static var clone_MethodID_3: jmethodID?
override open func clone() throws /* java.lang.CloneNotSupportedException */ -> JavaObject! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "clone", methodSig: "()Ljava/lang/Object;", methodCache: &JavaEnum.clone_MethodID_3, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
if let throwable = JNI.ExceptionCheck() {
defer { JNI.DeleteLocalRef( throwable ) }
throw /* class java.lang.CloneNotSupportedException */ UnavailableObject( javaObject: throwable )
}
return __return != nil ? JavaObject( javaObject: __return ) : nil
}
/// public final int java.lang.Enum.compareTo(java.lang.Enum)
private static var compareTo_MethodID_4: jmethodID?
open func compareTo( o: JavaEnum? ) -> Int {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = JNIType.toJava( value: o, locals: &__locals )
let __return = JNIMethod.CallIntMethod( object: javaObject, methodName: "compareTo", methodSig: "(Ljava/lang/Enum;)I", methodCache: &JavaEnum.compareTo_MethodID_4, args: &__args, locals: &__locals )
return Int(__return)
}
open func compareTo( _ _o: JavaEnum? ) -> Int {
return compareTo( o: _o )
}
/// public int java.lang.Enum.compareTo(java.lang.Object)
private static var compareTo_MethodID_5: jmethodID?
open func compareTo( arg0: JavaObject? ) -> Int {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = JNIType.toJava( value: arg0, locals: &__locals )
let __return = JNIMethod.CallIntMethod( object: javaObject, methodName: "compareTo", methodSig: "(Ljava/lang/Object;)I", methodCache: &JavaEnum.compareTo_MethodID_5, args: &__args, locals: &__locals )
return Int(__return)
}
open func compareTo( _ _arg0: JavaObject? ) -> Int {
return compareTo( arg0: _arg0 )
}
/// public final boolean java.lang.Enum.equals(java.lang.Object)
private static var equals_MethodID_6: jmethodID?
open func equals( other: JavaObject? ) -> Bool {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = JNIType.toJava( value: other, locals: &__locals )
let __return = JNIMethod.CallBooleanMethod( object: javaObject, methodName: "equals", methodSig: "(Ljava/lang/Object;)Z", methodCache: &JavaEnum.equals_MethodID_6, args: &__args, locals: &__locals )
return __return != jboolean(JNI_FALSE)
}
override open func equals( _ _other: JavaObject? ) -> Bool {
return equals( other: _other )
}
/// protected final void java.lang.Enum.finalize()
private static var finalize_MethodID_7: jmethodID?
override open func finalize() {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
JNIMethod.CallVoidMethod( object: javaObject, methodName: "finalize", methodSig: "()V", methodCache: &JavaEnum.finalize_MethodID_7, args: &__args, locals: &__locals )
}
/// public final java.lang.Class java.lang.Enum.getDeclaringClass()
private static var getDeclaringClass_MethodID_8: jmethodID?
open func getDeclaringClass() -> JavaClass! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "getDeclaringClass", methodSig: "()Ljava/lang/Class;", methodCache: &JavaEnum.getDeclaringClass_MethodID_8, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
return __return != nil ? JavaClass( javaObject: __return ) : nil
}
/// public final int java.lang.Enum.hashCode()
// Skipping method: false true false false false
/// public final java.lang.String java.lang.Enum.name()
private static var name_MethodID_9: jmethodID?
open func name() -> String! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "name", methodSig: "()Ljava/lang/String;", methodCache: &JavaEnum.name_MethodID_9, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
return __return != nil ? String( javaObject: __return ) : nil
}
/// public final int java.lang.Enum.ordinal()
private static var ordinal_MethodID_10: jmethodID?
open func ordinal() -> Int {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __return = JNIMethod.CallIntMethod( object: javaObject, methodName: "ordinal", methodSig: "()I", methodCache: &JavaEnum.ordinal_MethodID_10, args: &__args, locals: &__locals )
return Int(__return)
}
/// private void java.lang.Enum.readObject(java.io.ObjectInputStream) throws java.io.IOException,java.lang.ClassNotFoundException
/// private void java.lang.Enum.readObjectNoData() throws java.io.ObjectStreamException
/// public java.lang.String java.lang.Enum.toString()
// Skipping method: false true false false false
}