File: java.go.golden

package info (click to toggle)
golang-golang-x-mobile 0.0~git20251126.5c265dc-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,836 kB
  • sloc: objc: 1,536; java: 1,489; ansic: 1,159; xml: 365; asm: 34; sh: 14; makefile: 5
file content (407 lines) | stat: -rw-r--r-- 9,430 bytes parent folder | download
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
// Code generated by gobind. DO NOT EDIT.

package Float

import "Java"

const _ = Java.Dummy

const (
	MAX_VALUE    = 3.4028235E38
	MIN_NORMAL   = 1.17549435E-38
	MIN_VALUE    = 1.4E-45
	MAX_EXPONENT = 127
	MIN_EXPONENT = -126
	SIZE         = 32
	BYTES        = 4
)

var (
	// Cast takes a proxy for a Java object and converts it to a java.lang.Float proxy.
	// Cast panics if the argument is not a proxy or if the underlying object does
	// not extend or implement java.lang.Float.
	Cast func(v interface{}) Java.Java_lang_Float
)
// Code generated by gobind. DO NOT EDIT.

package lang

import "Java"

const _ = Java.Dummy

type Float Java.Java_lang_Float
type Long Java.Java_lang_Long
type Object Java.Java_lang_Object
type Runnable Java.Java_lang_Runnable
// Code generated by gobind. DO NOT EDIT.

package Long

import "Java"

const _ = Java.Dummy

const (
	MIN_VALUE = -9223372036854775808
	MAX_VALUE = 9223372036854775807
	SIZE      = 64
	BYTES     = 8
)

var (
	// Cast takes a proxy for a Java object and converts it to a java.lang.Long proxy.
	// Cast panics if the argument is not a proxy or if the underlying object does
	// not extend or implement java.lang.Long.
	Cast func(v interface{}) Java.Java_lang_Long
)
// Code generated by gobind. DO NOT EDIT.

package Object

import "Java"

const _ = Java.Dummy

const ()

var (
	// Cast takes a proxy for a Java object and converts it to a java.lang.Object proxy.
	// Cast panics if the argument is not a proxy or if the underlying object does
	// not extend or implement java.lang.Object.
	Cast func(v interface{}) Java.Java_lang_Object
)
// Code generated by gobind. DO NOT EDIT.

package Runnable

import "Java"

const _ = Java.Dummy

const ()

var (
	// Cast takes a proxy for a Java object and converts it to a java.lang.Runnable proxy.
	// Cast panics if the argument is not a proxy or if the underlying object does
	// not extend or implement java.lang.Runnable.
	Cast func(v interface{}) Java.Java_lang_Runnable
)
// Code generated by gobind. DO NOT EDIT.

package Java

// Used to silence this package not used errors
const Dummy = 0

type Java_lang_Float interface {
	ToString() string
}

type Java_lang_Long interface {
	ToString() string
}

type Java_lang_Object interface {
	ToString() string
}

type Java_lang_Runnable interface {
}
// Code generated by gobind. DO NOT EDIT.

package main

/*
#include <stdlib.h> // for free()
#include <jni.h>
#include "seq.h"
#include "classes.h"
*/
import "C"

import (
	"Java"
	_seq "golang.org/x/mobile/bind/seq"
)

import "Java/java/lang/Float"
import "Java/java/lang/Long"
import "Java/java/lang/Object"
import "Java/java/lang/Runnable"
import "unsafe"

import "reflect"

import "fmt"

type proxy interface{ Bind_proxy_refnum__() int32 }

// Suppress unused package error

var _ = _seq.FromRefNum

const _ = Java.Dummy

//export initClasses
func initClasses() {
	C.init_proxies()
	init_java_lang_Float()
	init_java_lang_Long()
	init_java_lang_Object()
	init_java_lang_Runnable()
}

var class_java_lang_Float C.jclass

func init_java_lang_Float() {
	cls := C.CString("java/lang/Float")
	clazz := C.go_seq_find_class(cls)
	C.free(unsafe.Pointer(cls))
	if uintptr(clazz) == 0 {
		return
	}
	class_java_lang_Float = clazz
	Float.Cast = func(v interface{}) Java.Java_lang_Float {
		t := reflect.TypeOf((*proxy_class_java_lang_Float)(nil))
		cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Float)
		ref := C.jint(_seq.ToRefNum(cv))
		if C.go_seq_isinstanceof(ref, class_java_lang_Float) != 1 {
			panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Float"))
		}
		return cv
	}
}

type proxy_class_java_lang_Float _seq.Ref

func (p *proxy_class_java_lang_Float) Bind_proxy_refnum__() int32 {
	return (*_seq.Ref)(p).Bind_IncNum()
}

func (p *proxy_class_java_lang_Float) ToString() string {
	res := C.cproxy_java_lang_Float_toString(C.jint(p.Bind_proxy_refnum__()))
	_res := decodeString(res.res)
	var _exc error
	_exc_ref := _seq.FromRefNum(int32(res.exc))
	if _exc_ref != nil {
		if res.exc < 0 { // go object
			_exc = _exc_ref.Get().(error)
		} else { // foreign object
			_exc = (*proxy_error)(_exc_ref)
		}
	}
	if _exc != nil {
		panic(_exc)
	}
	return _res
}

var class_java_lang_Long C.jclass

func init_java_lang_Long() {
	cls := C.CString("java/lang/Long")
	clazz := C.go_seq_find_class(cls)
	C.free(unsafe.Pointer(cls))
	if uintptr(clazz) == 0 {
		return
	}
	class_java_lang_Long = clazz
	Long.Cast = func(v interface{}) Java.Java_lang_Long {
		t := reflect.TypeOf((*proxy_class_java_lang_Long)(nil))
		cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Long)
		ref := C.jint(_seq.ToRefNum(cv))
		if C.go_seq_isinstanceof(ref, class_java_lang_Long) != 1 {
			panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Long"))
		}
		return cv
	}
}

type proxy_class_java_lang_Long _seq.Ref

func (p *proxy_class_java_lang_Long) Bind_proxy_refnum__() int32 {
	return (*_seq.Ref)(p).Bind_IncNum()
}

func (p *proxy_class_java_lang_Long) ToString() string {
	res := C.cproxy_java_lang_Long_toString(C.jint(p.Bind_proxy_refnum__()))
	_res := decodeString(res.res)
	var _exc error
	_exc_ref := _seq.FromRefNum(int32(res.exc))
	if _exc_ref != nil {
		if res.exc < 0 { // go object
			_exc = _exc_ref.Get().(error)
		} else { // foreign object
			_exc = (*proxy_error)(_exc_ref)
		}
	}
	if _exc != nil {
		panic(_exc)
	}
	return _res
}

var class_java_lang_Object C.jclass

func init_java_lang_Object() {
	cls := C.CString("java/lang/Object")
	clazz := C.go_seq_find_class(cls)
	C.free(unsafe.Pointer(cls))
	if uintptr(clazz) == 0 {
		return
	}
	class_java_lang_Object = clazz
	Object.Cast = func(v interface{}) Java.Java_lang_Object {
		t := reflect.TypeOf((*proxy_class_java_lang_Object)(nil))
		cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Object)
		ref := C.jint(_seq.ToRefNum(cv))
		if C.go_seq_isinstanceof(ref, class_java_lang_Object) != 1 {
			panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Object"))
		}
		return cv
	}
}

type proxy_class_java_lang_Object _seq.Ref

func (p *proxy_class_java_lang_Object) Bind_proxy_refnum__() int32 {
	return (*_seq.Ref)(p).Bind_IncNum()
}

func (p *proxy_class_java_lang_Object) ToString() string {
	res := C.cproxy_java_lang_Object_toString(C.jint(p.Bind_proxy_refnum__()))
	_res := decodeString(res.res)
	var _exc error
	_exc_ref := _seq.FromRefNum(int32(res.exc))
	if _exc_ref != nil {
		if res.exc < 0 { // go object
			_exc = _exc_ref.Get().(error)
		} else { // foreign object
			_exc = (*proxy_error)(_exc_ref)
		}
	}
	if _exc != nil {
		panic(_exc)
	}
	return _res
}

var class_java_lang_Runnable C.jclass

func init_java_lang_Runnable() {
	cls := C.CString("java/lang/Runnable")
	clazz := C.go_seq_find_class(cls)
	C.free(unsafe.Pointer(cls))
	if uintptr(clazz) == 0 {
		return
	}
	class_java_lang_Runnable = clazz
	Runnable.Cast = func(v interface{}) Java.Java_lang_Runnable {
		t := reflect.TypeOf((*proxy_class_java_lang_Runnable)(nil))
		cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Runnable)
		ref := C.jint(_seq.ToRefNum(cv))
		if C.go_seq_isinstanceof(ref, class_java_lang_Runnable) != 1 {
			panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Runnable"))
		}
		return cv
	}
}

type proxy_class_java_lang_Runnable _seq.Ref

func (p *proxy_class_java_lang_Runnable) Bind_proxy_refnum__() int32 {
	return (*_seq.Ref)(p).Bind_IncNum()
}
// Code generated by gobind. DO NOT EDIT.

// Package main is an autogenerated binder stub for package java.
//
//   autogenerated by gobind -lang=go java
package main

/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "java.h"

*/
import "C"

import (
	_seq "golang.org/x/mobile/bind/seq"
	"java"
)

// suppress the error if seq ends up unused
var _ = _seq.FromRefNum

//export proxyjava_F_ToString
func proxyjava_F_ToString(refnum C.int32_t) C.nstring {
	ref := _seq.FromRefNum(int32(refnum))
	v := ref.Get().(java.F)
	res_0 := v.ToString()
	_res_0 := encodeString(res_0)
	return _res_0
}

type proxyjava_F _seq.Ref

func (p *proxyjava_F) Bind_proxy_refnum__() int32 {
	return (*_seq.Ref)(p).Bind_IncNum()
}

func (p *proxyjava_F) ToString() string {
	res := C.cproxyjava_F_ToString(C.int32_t(p.Bind_proxy_refnum__()))
	_res := decodeString(res)
	return _res
}

//export proxyjava_L_ToString
func proxyjava_L_ToString(refnum C.int32_t) C.nstring {
	ref := _seq.FromRefNum(int32(refnum))
	v := ref.Get().(java.L)
	res_0 := v.ToString()
	_res_0 := encodeString(res_0)
	return _res_0
}

type proxyjava_L _seq.Ref

func (p *proxyjava_L) Bind_proxy_refnum__() int32 {
	return (*_seq.Ref)(p).Bind_IncNum()
}

func (p *proxyjava_L) ToString() string {
	res := C.cproxyjava_L_ToString(C.int32_t(p.Bind_proxy_refnum__()))
	_res := decodeString(res)
	return _res
}

//export proxyjava_O_ToString
func proxyjava_O_ToString(refnum C.int32_t) C.nstring {
	ref := _seq.FromRefNum(int32(refnum))
	v := ref.Get().(java.O)
	res_0 := v.ToString()
	_res_0 := encodeString(res_0)
	return _res_0
}

type proxyjava_O _seq.Ref

func (p *proxyjava_O) Bind_proxy_refnum__() int32 {
	return (*_seq.Ref)(p).Bind_IncNum()
}

func (p *proxyjava_O) ToString() string {
	res := C.cproxyjava_O_ToString(C.int32_t(p.Bind_proxy_refnum__()))
	_res := decodeString(res)
	return _res
}

type proxyjava_R _seq.Ref

func (p *proxyjava_R) Bind_proxy_refnum__() int32 {
	return (*_seq.Ref)(p).Bind_IncNum()
}