-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDelayQueue.swift
More file actions
422 lines (276 loc) · 17.3 KB
/
DelayQueue.swift
File metadata and controls
422 lines (276 loc) · 17.3 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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
import java_swift
import java_lang
/// generated by: genswift.java 'java/lang|java/util|java/sql|java/awt|javax/swing' ///
/// class java.util.concurrent.DelayQueue ///
open class DelayQueue: AbstractQueue {
public convenience init?( casting object: java_swift.JavaObject, _ file: StaticString = #file, _ line: Int = #line ) {
self.init( javaObject: nil )
object.withJavaObject {
self.javaObject = $0
}
}
private static var DelayQueueJNIClass: jclass?
/// private final java.util.concurrent.locks.Condition java.util.concurrent.DelayQueue.available
/// private java.lang.Thread java.util.concurrent.DelayQueue.leader
/// private final transient java.util.concurrent.locks.ReentrantLock java.util.concurrent.DelayQueue.lock
/// private final java.util.PriorityQueue java.util.concurrent.DelayQueue.q
/// private static final int java.util.AbstractCollection.MAX_ARRAY_SIZE
/// public java.util.concurrent.DelayQueue()
private static var new_MethodID_1: jmethodID?
public convenience init() {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __object = JNIMethod.NewObject( className: "java/util/concurrent/DelayQueue", classCache: &DelayQueue.DelayQueueJNIClass, methodSig: "()V", methodCache: &DelayQueue.new_MethodID_1, args: &__args, locals: &__locals )
self.init( javaObject: __object )
JNI.DeleteLocalRef( __object )
}
/// public java.util.concurrent.DelayQueue(java.util.Collection)
private static var new_MethodID_2: jmethodID?
public convenience init( c: Collection? ) {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = JNIType.toJava( value: c, locals: &__locals )
let __object = JNIMethod.NewObject( className: "java/util/concurrent/DelayQueue", classCache: &DelayQueue.DelayQueueJNIClass, methodSig: "(Ljava/util/Collection;)V", methodCache: &DelayQueue.new_MethodID_2, args: &__args, locals: &__locals )
self.init( javaObject: __object )
JNI.DeleteLocalRef( __object )
}
public convenience init( _ _c: Collection? ) {
self.init( c: _c )
}
/// public boolean java.util.concurrent.DelayQueue.add(java.util.concurrent.Delayed)
private static var add_MethodID_3: jmethodID?
open func add( e: Delayed? ) -> Bool {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = JNIType.toJava( value: e, locals: &__locals )
let __return = JNIMethod.CallBooleanMethod( object: javaObject, methodName: "add", methodSig: "(Ljava/util/concurrent/Delayed;)Z", methodCache: &DelayQueue.add_MethodID_3, args: &__args, locals: &__locals )
return __return != jboolean(JNI_FALSE)
}
open func add( _ _e: Delayed? ) -> Bool {
return add( e: _e )
}
/// public boolean java.util.concurrent.DelayQueue.add(java.lang.Object)
// Skipping method: false true false false false
/// public void java.util.concurrent.DelayQueue.clear()
// Skipping method: false true false false false
/// public int java.util.concurrent.DelayQueue.drainTo(java.util.Collection)
private static var drainTo_MethodID_4: jmethodID?
open func drainTo( c: Collection? ) -> Int {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = JNIType.toJava( value: c, locals: &__locals )
let __return = JNIMethod.CallIntMethod( object: javaObject, methodName: "drainTo", methodSig: "(Ljava/util/Collection;)I", methodCache: &DelayQueue.drainTo_MethodID_4, args: &__args, locals: &__locals )
return Int(__return)
}
open func drainTo( _ _c: Collection? ) -> Int {
return drainTo( c: _c )
}
/// public int java.util.concurrent.DelayQueue.drainTo(java.util.Collection,int)
private static var drainTo_MethodID_5: jmethodID?
open func drainTo( c: Collection?, maxElements: Int ) -> Int {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 2 )
__args[0] = JNIType.toJava( value: c, locals: &__locals )
__args[1] = jvalue( i: jint(maxElements) )
let __return = JNIMethod.CallIntMethod( object: javaObject, methodName: "drainTo", methodSig: "(Ljava/util/Collection;I)I", methodCache: &DelayQueue.drainTo_MethodID_5, args: &__args, locals: &__locals )
return Int(__return)
}
open func drainTo( _ _c: Collection?, _ _maxElements: Int ) -> Int {
return drainTo( c: _c, maxElements: _maxElements )
}
/// public java.util.Iterator java.util.concurrent.DelayQueue.iterator()
// Skipping method: false true false false false
/// public boolean java.util.concurrent.DelayQueue.offer(java.util.concurrent.Delayed)
private static var offer_MethodID_6: jmethodID?
open func offer( e: Delayed? ) -> Bool {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = JNIType.toJava( value: e, locals: &__locals )
let __return = JNIMethod.CallBooleanMethod( object: javaObject, methodName: "offer", methodSig: "(Ljava/util/concurrent/Delayed;)Z", methodCache: &DelayQueue.offer_MethodID_6, args: &__args, locals: &__locals )
return __return != jboolean(JNI_FALSE)
}
open func offer( _ _e: Delayed? ) -> Bool {
return offer( e: _e )
}
/// public boolean java.util.concurrent.DelayQueue.offer(java.util.concurrent.Delayed,long,java.util.concurrent.TimeUnit)
private static var offer_MethodID_7: jmethodID?
open func offer( e: Delayed?, timeout: Int64, unit: TimeUnit? ) -> Bool {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 3 )
__args[0] = JNIType.toJava( value: e, locals: &__locals )
__args[1] = jvalue( j: timeout )
__args[2] = JNIType.toJava( value: unit, locals: &__locals )
let __return = JNIMethod.CallBooleanMethod( object: javaObject, methodName: "offer", methodSig: "(Ljava/util/concurrent/Delayed;JLjava/util/concurrent/TimeUnit;)Z", methodCache: &DelayQueue.offer_MethodID_7, args: &__args, locals: &__locals )
return __return != jboolean(JNI_FALSE)
}
open func offer( _ _e: Delayed?, _ _timeout: Int64, _ _unit: TimeUnit? ) -> Bool {
return offer( e: _e, timeout: _timeout, unit: _unit )
}
/// public boolean java.util.concurrent.DelayQueue.offer(java.lang.Object)
// Skipping method: false true false false false
/// public boolean java.util.concurrent.DelayQueue.offer(java.lang.Object,long,java.util.concurrent.TimeUnit) throws java.lang.InterruptedException
private static var offer_MethodID_8: jmethodID?
open func offer( e: java_swift.JavaObject?, timeout: Int64, unit: TimeUnit? ) throws /* java.lang.InterruptedException */ -> Bool {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 3 )
__args[0] = JNIType.toJava( value: e, locals: &__locals )
__args[1] = jvalue( j: timeout )
__args[2] = JNIType.toJava( value: unit, locals: &__locals )
let __return = JNIMethod.CallBooleanMethod( object: javaObject, methodName: "offer", methodSig: "(Ljava/lang/Object;JLjava/util/concurrent/TimeUnit;)Z", methodCache: &DelayQueue.offer_MethodID_8, args: &__args, locals: &__locals )
if let throwable = JNI.ExceptionCheck() {
defer { JNI.DeleteLocalRef( throwable ) }
throw java_lang.InterruptedException( javaObject: throwable )
}
return __return != jboolean(JNI_FALSE)
}
open func offer( _ _e: java_swift.JavaObject?, _ _timeout: Int64, _ _unit: TimeUnit? ) throws /* java.lang.InterruptedException */ -> Bool {
return try offer( e: _e, timeout: _timeout, unit: _unit )
}
/// public java.lang.Object java.util.concurrent.DelayQueue.peek()
// Skipping method: false true false false false
/// public java.util.concurrent.Delayed java.util.concurrent.DelayQueue.peek()
// Skipping method: false true false false false
/// private java.util.concurrent.Delayed java.util.concurrent.DelayQueue.peekExpired()
/// public java.util.concurrent.Delayed java.util.concurrent.DelayQueue.poll(long,java.util.concurrent.TimeUnit) throws java.lang.InterruptedException
private static var poll_MethodID_9: jmethodID?
open func poll( timeout: Int64, unit: TimeUnit? ) throws /* java.lang.InterruptedException */ -> Delayed! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 2 )
__args[0] = jvalue( j: timeout )
__args[1] = JNIType.toJava( value: unit, locals: &__locals )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "poll", methodSig: "(JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/Delayed;", methodCache: &DelayQueue.poll_MethodID_9, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
if let throwable = JNI.ExceptionCheck() {
defer { JNI.DeleteLocalRef( throwable ) }
throw java_lang.InterruptedException( javaObject: throwable )
}
return __return != nil ? DelayedForward( javaObject: __return ) : nil
}
open func poll( _ _timeout: Int64, _ _unit: TimeUnit? ) throws /* java.lang.InterruptedException */ -> Delayed! {
return try poll( timeout: _timeout, unit: _unit )
}
/// public java.lang.Object java.util.concurrent.DelayQueue.poll(long,java.util.concurrent.TimeUnit) throws java.lang.InterruptedException
/// public java.util.concurrent.Delayed java.util.concurrent.DelayQueue.poll()
// Skipping method: false true false false false
/// public java.lang.Object java.util.concurrent.DelayQueue.poll()
// Skipping method: false true false false false
/// public void java.util.concurrent.DelayQueue.put(java.util.concurrent.Delayed)
private static var put_MethodID_10: jmethodID?
open func put( e: Delayed? ) {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = JNIType.toJava( value: e, locals: &__locals )
JNIMethod.CallVoidMethod( object: javaObject, methodName: "put", methodSig: "(Ljava/util/concurrent/Delayed;)V", methodCache: &DelayQueue.put_MethodID_10, args: &__args, locals: &__locals )
}
open func put( _ _e: Delayed? ) {
put( e: _e )
}
/// public void java.util.concurrent.DelayQueue.put(java.lang.Object) throws java.lang.InterruptedException
private static var put_MethodID_11: jmethodID?
open func put( e: java_swift.JavaObject? ) throws /* java.lang.InterruptedException */ {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = JNIType.toJava( value: e, locals: &__locals )
JNIMethod.CallVoidMethod( object: javaObject, methodName: "put", methodSig: "(Ljava/lang/Object;)V", methodCache: &DelayQueue.put_MethodID_11, args: &__args, locals: &__locals )
if let throwable = JNI.ExceptionCheck() {
defer { JNI.DeleteLocalRef( throwable ) }
throw java_lang.InterruptedException( javaObject: throwable )
}
}
open func put( _ _e: java_swift.JavaObject? ) throws /* java.lang.InterruptedException */ {
try put( e: _e )
}
/// public int java.util.concurrent.DelayQueue.remainingCapacity()
private static var remainingCapacity_MethodID_12: jmethodID?
open func remainingCapacity() -> Int {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __return = JNIMethod.CallIntMethod( object: javaObject, methodName: "remainingCapacity", methodSig: "()I", methodCache: &DelayQueue.remainingCapacity_MethodID_12, args: &__args, locals: &__locals )
return Int(__return)
}
/// public boolean java.util.concurrent.DelayQueue.remove(java.lang.Object)
// Skipping method: false true false false false
/// void java.util.concurrent.DelayQueue.removeEQ(java.lang.Object)
// Skipping method: true false false false false
/// public int java.util.concurrent.DelayQueue.size()
// Skipping method: false true false false false
/// public java.util.concurrent.Delayed java.util.concurrent.DelayQueue.take() throws java.lang.InterruptedException
private static var take_MethodID_13: jmethodID?
open func take() throws /* java.lang.InterruptedException */ -> Delayed! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "take", methodSig: "()Ljava/util/concurrent/Delayed;", methodCache: &DelayQueue.take_MethodID_13, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
if let throwable = JNI.ExceptionCheck() {
defer { JNI.DeleteLocalRef( throwable ) }
throw java_lang.InterruptedException( javaObject: throwable )
}
return __return != nil ? DelayedForward( javaObject: __return ) : nil
}
/// public java.lang.Object java.util.concurrent.DelayQueue.take() throws java.lang.InterruptedException
/// public java.lang.Object[] java.util.concurrent.DelayQueue.toArray(java.lang.Object[])
// Skipping method: false true false false false
/// public java.lang.Object[] java.util.concurrent.DelayQueue.toArray()
// Skipping method: false true false false false
/// In declared protocol but not defined.. ///
/// public abstract boolean java.util.Collection.add(java.lang.Object)
// Skipping method: false true false false false
/// public abstract boolean java.util.Collection.addAll(java.util.Collection)
// Skipping method: false true false false false
/// public abstract void java.util.Collection.clear()
// Skipping method: false true false false false
/// public abstract boolean java.util.Collection.contains(java.lang.Object)
// Skipping method: false true false false false
/// public abstract boolean java.util.Collection.containsAll(java.util.Collection)
// Skipping method: false true false false false
/// public abstract java.lang.Object java.util.Queue.element()
// Skipping method: false true false false false
/// public abstract boolean java.util.Collection.equals(java.lang.Object)
private static var equals_MethodID_14: jmethodID?
override open func equals( o: java_swift.JavaObject? ) -> Bool {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = JNIType.toJava( value: o, locals: &__locals )
let __return = JNIMethod.CallBooleanMethod( object: javaObject, methodName: "equals", methodSig: "(Ljava/lang/Object;)Z", methodCache: &DelayQueue.equals_MethodID_14, args: &__args, locals: &__locals )
return __return != jboolean(JNI_FALSE)
}
override open func equals( _ _o: java_swift.JavaObject? ) -> Bool {
return equals( o: _o )
}
/// public default void java.lang.Iterable.forEach(java.util.function.Consumer)
// Skipping method: false true false false false
/// public abstract int java.util.Collection.hashCode()
// Skipping method: false true false false false
/// public abstract boolean java.util.Collection.isEmpty()
// Skipping method: false true false false false
/// public abstract java.util.Iterator java.lang.Iterable.iterator()
// Skipping method: false true false false false
/// public abstract boolean java.util.Queue.offer(java.lang.Object)
// Skipping method: false true false false false
/// public default java.util.stream.Stream java.util.Collection.parallelStream()
// Skipping method: false true false false false
/// public abstract java.lang.Object java.util.Queue.peek()
// Skipping method: false true false false false
/// public abstract java.lang.Object java.util.Queue.poll()
// Skipping method: false true false false false
/// public abstract boolean java.util.Collection.remove(java.lang.Object)
// Skipping method: false true false false false
/// public abstract java.lang.Object java.util.Queue.remove()
// Skipping method: false true false false false
/// public abstract boolean java.util.Collection.removeAll(java.util.Collection)
// Skipping method: false true false false false
/// public default boolean java.util.Collection.removeIf(java.util.function.Predicate)
// Skipping method: false true false false false
/// public abstract boolean java.util.Collection.retainAll(java.util.Collection)
// Skipping method: false true false false false
/// public abstract int java.util.Collection.size()
// Skipping method: false true false false false
/// public default java.util.Spliterator java.lang.Iterable.spliterator()
// Skipping method: false true false false false
/// public default java.util.stream.Stream java.util.Collection.stream()
// Skipping method: false true false false false
/// public abstract java.lang.Object[] java.util.Collection.toArray(java.lang.Object[])
// Skipping method: false true false false false
/// public abstract java.lang.Object[] java.util.Collection.toArray()
// Skipping method: false true false false false
}