java.go.golden 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. // Code generated by gobind. DO NOT EDIT.
  2. package Float
  3. import "Java"
  4. const _ = Java.Dummy
  5. const (
  6. MAX_VALUE = 3.4028235E38
  7. MIN_NORMAL = 1.17549435E-38
  8. MIN_VALUE = 1.4E-45
  9. MAX_EXPONENT = 127
  10. MIN_EXPONENT = -126
  11. SIZE = 32
  12. BYTES = 4
  13. )
  14. var (
  15. // Cast takes a proxy for a Java object and converts it to a java.lang.Float proxy.
  16. // Cast panics if the argument is not a proxy or if the underlying object does
  17. // not extend or implement java.lang.Float.
  18. Cast func(v interface{}) Java.Java_lang_Float
  19. )
  20. // Code generated by gobind. DO NOT EDIT.
  21. package lang
  22. import "Java"
  23. const _ = Java.Dummy
  24. type Float Java.Java_lang_Float
  25. type Long Java.Java_lang_Long
  26. type Object Java.Java_lang_Object
  27. type Runnable Java.Java_lang_Runnable
  28. // Code generated by gobind. DO NOT EDIT.
  29. package Long
  30. import "Java"
  31. const _ = Java.Dummy
  32. const (
  33. MIN_VALUE = -9223372036854775808
  34. MAX_VALUE = 9223372036854775807
  35. SIZE = 64
  36. BYTES = 8
  37. )
  38. var (
  39. // Cast takes a proxy for a Java object and converts it to a java.lang.Long proxy.
  40. // Cast panics if the argument is not a proxy or if the underlying object does
  41. // not extend or implement java.lang.Long.
  42. Cast func(v interface{}) Java.Java_lang_Long
  43. )
  44. // Code generated by gobind. DO NOT EDIT.
  45. package Object
  46. import "Java"
  47. const _ = Java.Dummy
  48. const ()
  49. var (
  50. // Cast takes a proxy for a Java object and converts it to a java.lang.Object proxy.
  51. // Cast panics if the argument is not a proxy or if the underlying object does
  52. // not extend or implement java.lang.Object.
  53. Cast func(v interface{}) Java.Java_lang_Object
  54. )
  55. // Code generated by gobind. DO NOT EDIT.
  56. package Runnable
  57. import "Java"
  58. const _ = Java.Dummy
  59. const ()
  60. var (
  61. // Cast takes a proxy for a Java object and converts it to a java.lang.Runnable proxy.
  62. // Cast panics if the argument is not a proxy or if the underlying object does
  63. // not extend or implement java.lang.Runnable.
  64. Cast func(v interface{}) Java.Java_lang_Runnable
  65. )
  66. // Code generated by gobind. DO NOT EDIT.
  67. package Java
  68. // Used to silence this package not used errors
  69. const Dummy = 0
  70. type Java_lang_Float interface {
  71. ToString() string
  72. }
  73. type Java_lang_Long interface {
  74. ToString() string
  75. }
  76. type Java_lang_Object interface {
  77. ToString() string
  78. }
  79. type Java_lang_Runnable interface {
  80. }
  81. // Code generated by gobind. DO NOT EDIT.
  82. package main
  83. /*
  84. #include <stdlib.h> // for free()
  85. #include <jni.h>
  86. #include "seq.h"
  87. #include "classes.h"
  88. */
  89. import "C"
  90. import (
  91. "Java"
  92. _seq "golang.org/x/mobile/bind/seq"
  93. )
  94. import "Java/java/lang/Float"
  95. import "Java/java/lang/Long"
  96. import "Java/java/lang/Object"
  97. import "Java/java/lang/Runnable"
  98. import "unsafe"
  99. import "reflect"
  100. import "fmt"
  101. type proxy interface{ Bind_proxy_refnum__() int32 }
  102. // Suppress unused package error
  103. var _ = _seq.FromRefNum
  104. const _ = Java.Dummy
  105. //export initClasses
  106. func initClasses() {
  107. C.init_proxies()
  108. init_java_lang_Float()
  109. init_java_lang_Long()
  110. init_java_lang_Object()
  111. init_java_lang_Runnable()
  112. }
  113. var class_java_lang_Float C.jclass
  114. func init_java_lang_Float() {
  115. cls := C.CString("java/lang/Float")
  116. clazz := C.go_seq_find_class(cls)
  117. C.free(unsafe.Pointer(cls))
  118. if uintptr(clazz) == 0 {
  119. return
  120. }
  121. class_java_lang_Float = clazz
  122. Float.Cast = func(v interface{}) Java.Java_lang_Float {
  123. t := reflect.TypeOf((*proxy_class_java_lang_Float)(nil))
  124. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Float)
  125. ref := C.jint(_seq.ToRefNum(cv))
  126. if C.go_seq_isinstanceof(ref, class_java_lang_Float) != 1 {
  127. panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Float"))
  128. }
  129. return cv
  130. }
  131. }
  132. type proxy_class_java_lang_Float _seq.Ref
  133. func (p *proxy_class_java_lang_Float) Bind_proxy_refnum__() int32 {
  134. return (*_seq.Ref)(p).Bind_IncNum()
  135. }
  136. func (p *proxy_class_java_lang_Float) ToString() string {
  137. res := C.cproxy_java_lang_Float_toString(C.jint(p.Bind_proxy_refnum__()))
  138. _res := decodeString(res.res)
  139. var _exc error
  140. _exc_ref := _seq.FromRefNum(int32(res.exc))
  141. if _exc_ref != nil {
  142. if res.exc < 0 { // go object
  143. _exc = _exc_ref.Get().(error)
  144. } else { // foreign object
  145. _exc = (*proxy_error)(_exc_ref)
  146. }
  147. }
  148. if _exc != nil {
  149. panic(_exc)
  150. }
  151. return _res
  152. }
  153. var class_java_lang_Long C.jclass
  154. func init_java_lang_Long() {
  155. cls := C.CString("java/lang/Long")
  156. clazz := C.go_seq_find_class(cls)
  157. C.free(unsafe.Pointer(cls))
  158. if uintptr(clazz) == 0 {
  159. return
  160. }
  161. class_java_lang_Long = clazz
  162. Long.Cast = func(v interface{}) Java.Java_lang_Long {
  163. t := reflect.TypeOf((*proxy_class_java_lang_Long)(nil))
  164. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Long)
  165. ref := C.jint(_seq.ToRefNum(cv))
  166. if C.go_seq_isinstanceof(ref, class_java_lang_Long) != 1 {
  167. panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Long"))
  168. }
  169. return cv
  170. }
  171. }
  172. type proxy_class_java_lang_Long _seq.Ref
  173. func (p *proxy_class_java_lang_Long) Bind_proxy_refnum__() int32 {
  174. return (*_seq.Ref)(p).Bind_IncNum()
  175. }
  176. func (p *proxy_class_java_lang_Long) ToString() string {
  177. res := C.cproxy_java_lang_Long_toString(C.jint(p.Bind_proxy_refnum__()))
  178. _res := decodeString(res.res)
  179. var _exc error
  180. _exc_ref := _seq.FromRefNum(int32(res.exc))
  181. if _exc_ref != nil {
  182. if res.exc < 0 { // go object
  183. _exc = _exc_ref.Get().(error)
  184. } else { // foreign object
  185. _exc = (*proxy_error)(_exc_ref)
  186. }
  187. }
  188. if _exc != nil {
  189. panic(_exc)
  190. }
  191. return _res
  192. }
  193. var class_java_lang_Object C.jclass
  194. func init_java_lang_Object() {
  195. cls := C.CString("java/lang/Object")
  196. clazz := C.go_seq_find_class(cls)
  197. C.free(unsafe.Pointer(cls))
  198. if uintptr(clazz) == 0 {
  199. return
  200. }
  201. class_java_lang_Object = clazz
  202. Object.Cast = func(v interface{}) Java.Java_lang_Object {
  203. t := reflect.TypeOf((*proxy_class_java_lang_Object)(nil))
  204. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Object)
  205. ref := C.jint(_seq.ToRefNum(cv))
  206. if C.go_seq_isinstanceof(ref, class_java_lang_Object) != 1 {
  207. panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Object"))
  208. }
  209. return cv
  210. }
  211. }
  212. type proxy_class_java_lang_Object _seq.Ref
  213. func (p *proxy_class_java_lang_Object) Bind_proxy_refnum__() int32 {
  214. return (*_seq.Ref)(p).Bind_IncNum()
  215. }
  216. func (p *proxy_class_java_lang_Object) ToString() string {
  217. res := C.cproxy_java_lang_Object_toString(C.jint(p.Bind_proxy_refnum__()))
  218. _res := decodeString(res.res)
  219. var _exc error
  220. _exc_ref := _seq.FromRefNum(int32(res.exc))
  221. if _exc_ref != nil {
  222. if res.exc < 0 { // go object
  223. _exc = _exc_ref.Get().(error)
  224. } else { // foreign object
  225. _exc = (*proxy_error)(_exc_ref)
  226. }
  227. }
  228. if _exc != nil {
  229. panic(_exc)
  230. }
  231. return _res
  232. }
  233. var class_java_lang_Runnable C.jclass
  234. func init_java_lang_Runnable() {
  235. cls := C.CString("java/lang/Runnable")
  236. clazz := C.go_seq_find_class(cls)
  237. C.free(unsafe.Pointer(cls))
  238. if uintptr(clazz) == 0 {
  239. return
  240. }
  241. class_java_lang_Runnable = clazz
  242. Runnable.Cast = func(v interface{}) Java.Java_lang_Runnable {
  243. t := reflect.TypeOf((*proxy_class_java_lang_Runnable)(nil))
  244. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Runnable)
  245. ref := C.jint(_seq.ToRefNum(cv))
  246. if C.go_seq_isinstanceof(ref, class_java_lang_Runnable) != 1 {
  247. panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Runnable"))
  248. }
  249. return cv
  250. }
  251. }
  252. type proxy_class_java_lang_Runnable _seq.Ref
  253. func (p *proxy_class_java_lang_Runnable) Bind_proxy_refnum__() int32 {
  254. return (*_seq.Ref)(p).Bind_IncNum()
  255. }
  256. // Code generated by gobind. DO NOT EDIT.
  257. // Package main is an autogenerated binder stub for package java.
  258. //
  259. // autogenerated by gobind -lang=go java
  260. package main
  261. /*
  262. #include <stdlib.h>
  263. #include <stdint.h>
  264. #include "seq.h"
  265. #include "java.h"
  266. */
  267. import "C"
  268. import (
  269. _seq "golang.org/x/mobile/bind/seq"
  270. "java"
  271. )
  272. // suppress the error if seq ends up unused
  273. var _ = _seq.FromRefNum
  274. //export proxyjava_F_ToString
  275. func proxyjava_F_ToString(refnum C.int32_t) C.nstring {
  276. ref := _seq.FromRefNum(int32(refnum))
  277. v := ref.Get().(java.F)
  278. res_0 := v.ToString()
  279. _res_0 := encodeString(res_0)
  280. return _res_0
  281. }
  282. type proxyjava_F _seq.Ref
  283. func (p *proxyjava_F) Bind_proxy_refnum__() int32 {
  284. return (*_seq.Ref)(p).Bind_IncNum()
  285. }
  286. func (p *proxyjava_F) ToString() string {
  287. res := C.cproxyjava_F_ToString(C.int32_t(p.Bind_proxy_refnum__()))
  288. _res := decodeString(res)
  289. return _res
  290. }
  291. //export proxyjava_L_ToString
  292. func proxyjava_L_ToString(refnum C.int32_t) C.nstring {
  293. ref := _seq.FromRefNum(int32(refnum))
  294. v := ref.Get().(java.L)
  295. res_0 := v.ToString()
  296. _res_0 := encodeString(res_0)
  297. return _res_0
  298. }
  299. type proxyjava_L _seq.Ref
  300. func (p *proxyjava_L) Bind_proxy_refnum__() int32 {
  301. return (*_seq.Ref)(p).Bind_IncNum()
  302. }
  303. func (p *proxyjava_L) ToString() string {
  304. res := C.cproxyjava_L_ToString(C.int32_t(p.Bind_proxy_refnum__()))
  305. _res := decodeString(res)
  306. return _res
  307. }
  308. //export proxyjava_O_ToString
  309. func proxyjava_O_ToString(refnum C.int32_t) C.nstring {
  310. ref := _seq.FromRefNum(int32(refnum))
  311. v := ref.Get().(java.O)
  312. res_0 := v.ToString()
  313. _res_0 := encodeString(res_0)
  314. return _res_0
  315. }
  316. type proxyjava_O _seq.Ref
  317. func (p *proxyjava_O) Bind_proxy_refnum__() int32 {
  318. return (*_seq.Ref)(p).Bind_IncNum()
  319. }
  320. func (p *proxyjava_O) ToString() string {
  321. res := C.cproxyjava_O_ToString(C.int32_t(p.Bind_proxy_refnum__()))
  322. _res := decodeString(res)
  323. return _res
  324. }
  325. type proxyjava_R _seq.Ref
  326. func (p *proxyjava_R) Bind_proxy_refnum__() int32 {
  327. return (*_seq.Ref)(p).Bind_IncNum()
  328. }