classes.go.golden 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136
  1. // Code generated by gobind. DO NOT EDIT.
  2. package Runnable
  3. import "Java"
  4. const _ = Java.Dummy
  5. const ()
  6. var (
  7. // Cast takes a proxy for a Java object and converts it to a java.lang.Runnable proxy.
  8. // Cast panics if the argument is not a proxy or if the underlying object does
  9. // not extend or implement java.lang.Runnable.
  10. Cast func(v interface{}) Java.Java_lang_Runnable
  11. )
  12. // Code generated by gobind. DO NOT EDIT.
  13. package lang
  14. import "Java"
  15. const _ = Java.Dummy
  16. type Runnable Java.Java_lang_Runnable
  17. type Object Java.Java_lang_Object
  18. type System Java.Java_lang_System
  19. // Code generated by gobind. DO NOT EDIT.
  20. package InputStream
  21. import "Java"
  22. const _ = Java.Dummy
  23. const ()
  24. var (
  25. // Cast takes a proxy for a Java object and converts it to a java.io.InputStream proxy.
  26. // Cast panics if the argument is not a proxy or if the underlying object does
  27. // not extend or implement java.io.InputStream.
  28. Cast func(v interface{}) Java.Java_io_InputStream
  29. )
  30. // Code generated by gobind. DO NOT EDIT.
  31. package io
  32. import "Java"
  33. const _ = Java.Dummy
  34. type InputStream Java.Java_io_InputStream
  35. type Console Java.Java_io_Console
  36. // Code generated by gobind. DO NOT EDIT.
  37. package Future
  38. import "Java"
  39. const _ = Java.Dummy
  40. const ()
  41. var (
  42. // Cast takes a proxy for a Java object and converts it to a java.util.concurrent.Future proxy.
  43. // Cast panics if the argument is not a proxy or if the underlying object does
  44. // not extend or implement java.util.concurrent.Future.
  45. Cast func(v interface{}) Java.Java_util_concurrent_Future
  46. )
  47. // Code generated by gobind. DO NOT EDIT.
  48. package concurrent
  49. import "Java"
  50. const _ = Java.Dummy
  51. type Future Java.Java_util_concurrent_Future
  52. type TimeUnit Java.Java_util_concurrent_TimeUnit
  53. // Code generated by gobind. DO NOT EDIT.
  54. package Object
  55. import "Java"
  56. const _ = Java.Dummy
  57. const ()
  58. var (
  59. // Cast takes a proxy for a Java object and converts it to a java.lang.Object proxy.
  60. // Cast panics if the argument is not a proxy or if the underlying object does
  61. // not extend or implement java.lang.Object.
  62. Cast func(v interface{}) Java.Java_lang_Object
  63. )
  64. // Code generated by gobind. DO NOT EDIT.
  65. package TimeUnit
  66. import "Java"
  67. const _ = Java.Dummy
  68. const ()
  69. var (
  70. // Cast takes a proxy for a Java object and converts it to a java.util.concurrent.TimeUnit proxy.
  71. // Cast panics if the argument is not a proxy or if the underlying object does
  72. // not extend or implement java.util.concurrent.TimeUnit.
  73. Cast func(v interface{}) Java.Java_util_concurrent_TimeUnit
  74. )
  75. // Code generated by gobind. DO NOT EDIT.
  76. package Spliterators
  77. import "Java"
  78. const _ = Java.Dummy
  79. const ()
  80. var (
  81. Iterator func(a0 Java.Java_util_Spliterator) Java.Java_util_Iterator
  82. // Cast takes a proxy for a Java object and converts it to a java.util.Spliterators proxy.
  83. // Cast panics if the argument is not a proxy or if the underlying object does
  84. // not extend or implement java.util.Spliterators.
  85. Cast func(v interface{}) Java.Java_util_Spliterators
  86. )
  87. // Code generated by gobind. DO NOT EDIT.
  88. package util
  89. import "Java"
  90. const _ = Java.Dummy
  91. type Spliterators Java.Java_util_Spliterators
  92. type Iterator Java.Java_util_Iterator
  93. type Spliterator Java.Java_util_Spliterator
  94. // Code generated by gobind. DO NOT EDIT.
  95. package System
  96. import "Java"
  97. const _ = Java.Dummy
  98. const ()
  99. var (
  100. Console func() Java.Java_io_Console
  101. // Cast takes a proxy for a Java object and converts it to a java.lang.System proxy.
  102. // Cast panics if the argument is not a proxy or if the underlying object does
  103. // not extend or implement java.lang.System.
  104. Cast func(v interface{}) Java.Java_lang_System
  105. )
  106. // Code generated by gobind. DO NOT EDIT.
  107. package Future
  108. import "Java"
  109. const _ = Java.Dummy
  110. const ()
  111. var (
  112. // Cast takes a proxy for a Java object and converts it to a java.Future proxy.
  113. // Cast panics if the argument is not a proxy or if the underlying object does
  114. // not extend or implement java.Future.
  115. Cast func(v interface{}) Java.Java_Future
  116. )
  117. // Code generated by gobind. DO NOT EDIT.
  118. package java
  119. import "Java"
  120. const _ = Java.Dummy
  121. type Future Java.Java_Future
  122. type InputStream Java.Java_InputStream
  123. type Object Java.Java_Object
  124. type Runnable Java.Java_Runnable
  125. // Code generated by gobind. DO NOT EDIT.
  126. package InputStream
  127. import "Java"
  128. const _ = Java.Dummy
  129. const ()
  130. var (
  131. // Cast takes a proxy for a Java object and converts it to a java.InputStream proxy.
  132. // Cast panics if the argument is not a proxy or if the underlying object does
  133. // not extend or implement java.InputStream.
  134. Cast func(v interface{}) Java.Java_InputStream
  135. )
  136. // Code generated by gobind. DO NOT EDIT.
  137. package Object
  138. import "Java"
  139. const _ = Java.Dummy
  140. const ()
  141. var (
  142. // Cast takes a proxy for a Java object and converts it to a java.Object proxy.
  143. // Cast panics if the argument is not a proxy or if the underlying object does
  144. // not extend or implement java.Object.
  145. Cast func(v interface{}) Java.Java_Object
  146. )
  147. // Code generated by gobind. DO NOT EDIT.
  148. package Runnable
  149. import "Java"
  150. const _ = Java.Dummy
  151. const ()
  152. var (
  153. // Cast takes a proxy for a Java object and converts it to a java.Runnable proxy.
  154. // Cast panics if the argument is not a proxy or if the underlying object does
  155. // not extend or implement java.Runnable.
  156. Cast func(v interface{}) Java.Java_Runnable
  157. )
  158. // Code generated by gobind. DO NOT EDIT.
  159. package Iterator
  160. import "Java"
  161. const _ = Java.Dummy
  162. const ()
  163. var (
  164. // Cast takes a proxy for a Java object and converts it to a java.util.Iterator proxy.
  165. // Cast panics if the argument is not a proxy or if the underlying object does
  166. // not extend or implement java.util.Iterator.
  167. Cast func(v interface{}) Java.Java_util_Iterator
  168. )
  169. // Code generated by gobind. DO NOT EDIT.
  170. package Spliterator
  171. import "Java"
  172. const _ = Java.Dummy
  173. type OfInt Java.Java_util_Spliterator_OfInt
  174. type OfLong Java.Java_util_Spliterator_OfLong
  175. type OfDouble Java.Java_util_Spliterator_OfDouble
  176. const (
  177. ORDERED = 16
  178. DISTINCT = 1
  179. SORTED = 4
  180. SIZED = 64
  181. NONNULL = 256
  182. IMMUTABLE = 1024
  183. CONCURRENT = 4096
  184. SUBSIZED = 16384
  185. )
  186. var (
  187. // Cast takes a proxy for a Java object and converts it to a java.util.Spliterator proxy.
  188. // Cast panics if the argument is not a proxy or if the underlying object does
  189. // not extend or implement java.util.Spliterator.
  190. Cast func(v interface{}) Java.Java_util_Spliterator
  191. )
  192. // Code generated by gobind. DO NOT EDIT.
  193. package OfInt
  194. import "Java"
  195. const _ = Java.Dummy
  196. const ()
  197. var (
  198. // Cast takes a proxy for a Java object and converts it to a java.util.PrimitiveIterator.OfInt proxy.
  199. // Cast panics if the argument is not a proxy or if the underlying object does
  200. // not extend or implement java.util.PrimitiveIterator.OfInt.
  201. Cast func(v interface{}) Java.Java_util_PrimitiveIterator_OfInt
  202. )
  203. // Code generated by gobind. DO NOT EDIT.
  204. package PrimitiveIterator
  205. import "Java"
  206. const _ = Java.Dummy
  207. type OfInt Java.Java_util_PrimitiveIterator_OfInt
  208. type OfLong Java.Java_util_PrimitiveIterator_OfLong
  209. type OfDouble Java.Java_util_PrimitiveIterator_OfDouble
  210. // Code generated by gobind. DO NOT EDIT.
  211. package OfInt
  212. import "Java"
  213. const _ = Java.Dummy
  214. const ()
  215. var (
  216. // Cast takes a proxy for a Java object and converts it to a java.util.Spliterator.OfInt proxy.
  217. // Cast panics if the argument is not a proxy or if the underlying object does
  218. // not extend or implement java.util.Spliterator.OfInt.
  219. Cast func(v interface{}) Java.Java_util_Spliterator_OfInt
  220. )
  221. // Code generated by gobind. DO NOT EDIT.
  222. package OfLong
  223. import "Java"
  224. const _ = Java.Dummy
  225. const ()
  226. var (
  227. // Cast takes a proxy for a Java object and converts it to a java.util.PrimitiveIterator.OfLong proxy.
  228. // Cast panics if the argument is not a proxy or if the underlying object does
  229. // not extend or implement java.util.PrimitiveIterator.OfLong.
  230. Cast func(v interface{}) Java.Java_util_PrimitiveIterator_OfLong
  231. )
  232. // Code generated by gobind. DO NOT EDIT.
  233. package OfLong
  234. import "Java"
  235. const _ = Java.Dummy
  236. const ()
  237. var (
  238. // Cast takes a proxy for a Java object and converts it to a java.util.Spliterator.OfLong proxy.
  239. // Cast panics if the argument is not a proxy or if the underlying object does
  240. // not extend or implement java.util.Spliterator.OfLong.
  241. Cast func(v interface{}) Java.Java_util_Spliterator_OfLong
  242. )
  243. // Code generated by gobind. DO NOT EDIT.
  244. package OfDouble
  245. import "Java"
  246. const _ = Java.Dummy
  247. const ()
  248. var (
  249. // Cast takes a proxy for a Java object and converts it to a java.util.PrimitiveIterator.OfDouble proxy.
  250. // Cast panics if the argument is not a proxy or if the underlying object does
  251. // not extend or implement java.util.PrimitiveIterator.OfDouble.
  252. Cast func(v interface{}) Java.Java_util_PrimitiveIterator_OfDouble
  253. )
  254. // Code generated by gobind. DO NOT EDIT.
  255. package OfDouble
  256. import "Java"
  257. const _ = Java.Dummy
  258. const ()
  259. var (
  260. // Cast takes a proxy for a Java object and converts it to a java.util.Spliterator.OfDouble proxy.
  261. // Cast panics if the argument is not a proxy or if the underlying object does
  262. // not extend or implement java.util.Spliterator.OfDouble.
  263. Cast func(v interface{}) Java.Java_util_Spliterator_OfDouble
  264. )
  265. // Code generated by gobind. DO NOT EDIT.
  266. package Console
  267. import "Java"
  268. const _ = Java.Dummy
  269. const ()
  270. var (
  271. // Cast takes a proxy for a Java object and converts it to a java.io.Console proxy.
  272. // Cast panics if the argument is not a proxy or if the underlying object does
  273. // not extend or implement java.io.Console.
  274. Cast func(v interface{}) Java.Java_io_Console
  275. )
  276. // Code generated by gobind. DO NOT EDIT.
  277. package Java
  278. // Used to silence this package not used errors
  279. const Dummy = 0
  280. type Java_lang_Runnable interface {
  281. Run()
  282. }
  283. type Java_io_InputStream interface {
  284. Read(a0 ...interface{}) (int32, error)
  285. ToString() string
  286. }
  287. type Java_util_concurrent_Future interface {
  288. Get(a0 ...interface{}) (Java_lang_Object, error)
  289. }
  290. type Java_lang_Object interface {
  291. ToString() string
  292. }
  293. type Java_util_concurrent_TimeUnit interface {
  294. ToString() string
  295. }
  296. type Java_util_Spliterators interface {
  297. ToString() string
  298. }
  299. type Java_lang_System interface {
  300. ToString() string
  301. }
  302. type Java_Future interface {
  303. Get(a0 ...interface{}) (Java_lang_Object, error)
  304. Super() Java_Future
  305. // Unwrap returns the Go object this Java instance
  306. // is wrapping.
  307. // The return value is a java.Future, but the delclared type is
  308. // interface{} to avoid import cycles.
  309. Unwrap() interface{}
  310. }
  311. type Java_InputStream interface {
  312. Read(a0 ...interface{}) (int32, error)
  313. ToString() string
  314. Super() Java_InputStream
  315. // Unwrap returns the Go object this Java instance
  316. // is wrapping.
  317. // The return value is a java.InputStream, but the delclared type is
  318. // interface{} to avoid import cycles.
  319. Unwrap() interface{}
  320. }
  321. type Java_Object interface {
  322. ToString() string
  323. Super() Java_Object
  324. // Unwrap returns the Go object this Java instance
  325. // is wrapping.
  326. // The return value is a java.Object, but the delclared type is
  327. // interface{} to avoid import cycles.
  328. Unwrap() interface{}
  329. }
  330. type Java_Runnable interface {
  331. Run()
  332. Super() Java_Runnable
  333. // Unwrap returns the Go object this Java instance
  334. // is wrapping.
  335. // The return value is a java.Runnable, but the delclared type is
  336. // interface{} to avoid import cycles.
  337. Unwrap() interface{}
  338. }
  339. type Java_util_Iterator interface {
  340. }
  341. type Java_util_Spliterator interface {
  342. }
  343. type Java_util_PrimitiveIterator_OfInt interface {
  344. }
  345. type Java_util_Spliterator_OfInt interface {
  346. }
  347. type Java_util_PrimitiveIterator_OfLong interface {
  348. }
  349. type Java_util_Spliterator_OfLong interface {
  350. }
  351. type Java_util_PrimitiveIterator_OfDouble interface {
  352. }
  353. type Java_util_Spliterator_OfDouble interface {
  354. }
  355. type Java_io_Console interface {
  356. Flush() error
  357. ToString() string
  358. }
  359. // Code generated by gobind. DO NOT EDIT.
  360. package main
  361. /*
  362. #include <stdlib.h> // for free()
  363. #include <jni.h>
  364. #include "seq.h"
  365. #include "classes.h"
  366. */
  367. import "C"
  368. import (
  369. "Java"
  370. _seq "golang.org/x/mobile/bind/seq"
  371. )
  372. import "Java/java/lang/Runnable"
  373. import "Java/java/io/InputStream"
  374. import "Java/java/util/concurrent/Future"
  375. import "Java/java/lang/Object"
  376. import "Java/java/util/concurrent/TimeUnit"
  377. import "Java/java/util/Spliterators"
  378. import "Java/java/lang/System"
  379. import "Java/java/Future"
  380. import "Java/java/InputStream"
  381. import "Java/java/Object"
  382. import "Java/java/Runnable"
  383. import "Java/java/util/Iterator"
  384. import "Java/java/util/Spliterator"
  385. import "Java/java/util/PrimitiveIterator/OfInt"
  386. import "Java/java/util/Spliterator/OfInt"
  387. import "Java/java/util/PrimitiveIterator/OfLong"
  388. import "Java/java/util/Spliterator/OfLong"
  389. import "Java/java/util/PrimitiveIterator/OfDouble"
  390. import "Java/java/util/Spliterator/OfDouble"
  391. import "Java/java/io/Console"
  392. import "testdata"
  393. import "unsafe"
  394. import "reflect"
  395. import "fmt"
  396. type proxy interface{ Bind_proxy_refnum__() int32 }
  397. // Suppress unused package error
  398. var _ = _seq.FromRefNum
  399. const _ = Java.Dummy
  400. //export initClasses
  401. func initClasses() {
  402. C.init_proxies()
  403. init_java_lang_Runnable()
  404. init_java_io_InputStream()
  405. init_java_util_concurrent_Future()
  406. init_java_lang_Object()
  407. init_java_util_concurrent_TimeUnit()
  408. init_java_util_Spliterators()
  409. init_java_lang_System()
  410. init_java_Future()
  411. init_java_InputStream()
  412. init_java_Object()
  413. init_java_Runnable()
  414. init_java_util_Iterator()
  415. init_java_util_Spliterator()
  416. init_java_util_PrimitiveIterator_OfInt()
  417. init_java_util_Spliterator_OfInt()
  418. init_java_util_PrimitiveIterator_OfLong()
  419. init_java_util_Spliterator_OfLong()
  420. init_java_util_PrimitiveIterator_OfDouble()
  421. init_java_util_Spliterator_OfDouble()
  422. init_java_io_Console()
  423. }
  424. var class_java_lang_Runnable C.jclass
  425. func init_java_lang_Runnable() {
  426. cls := C.CString("java/lang/Runnable")
  427. clazz := C.go_seq_find_class(cls)
  428. C.free(unsafe.Pointer(cls))
  429. if uintptr(clazz) == 0 {
  430. return
  431. }
  432. class_java_lang_Runnable = clazz
  433. Runnable.Cast = func(v interface{}) Java.Java_lang_Runnable {
  434. t := reflect.TypeOf((*proxy_class_java_lang_Runnable)(nil))
  435. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Runnable)
  436. ref := C.jint(_seq.ToRefNum(cv))
  437. if C.go_seq_isinstanceof(ref, class_java_lang_Runnable) != 1 {
  438. panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Runnable"))
  439. }
  440. return cv
  441. }
  442. }
  443. type proxy_class_java_lang_Runnable _seq.Ref
  444. func (p *proxy_class_java_lang_Runnable) Bind_proxy_refnum__() int32 {
  445. return (*_seq.Ref)(p).Bind_IncNum()
  446. }
  447. func (p *proxy_class_java_lang_Runnable) Run() {
  448. res := C.cproxy_java_lang_Runnable_run(C.jint(p.Bind_proxy_refnum__()))
  449. var _exc error
  450. _exc_ref := _seq.FromRefNum(int32(res))
  451. if _exc_ref != nil {
  452. if res < 0 { // go object
  453. _exc = _exc_ref.Get().(error)
  454. } else { // foreign object
  455. _exc = (*proxy_error)(_exc_ref)
  456. }
  457. }
  458. if _exc != nil {
  459. panic(_exc)
  460. }
  461. }
  462. var class_java_io_InputStream C.jclass
  463. func init_java_io_InputStream() {
  464. cls := C.CString("java/io/InputStream")
  465. clazz := C.go_seq_find_class(cls)
  466. C.free(unsafe.Pointer(cls))
  467. if uintptr(clazz) == 0 {
  468. return
  469. }
  470. class_java_io_InputStream = clazz
  471. InputStream.Cast = func(v interface{}) Java.Java_io_InputStream {
  472. t := reflect.TypeOf((*proxy_class_java_io_InputStream)(nil))
  473. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_io_InputStream)
  474. ref := C.jint(_seq.ToRefNum(cv))
  475. if C.go_seq_isinstanceof(ref, class_java_io_InputStream) != 1 {
  476. panic(fmt.Errorf("%T is not an instance of %s", v, "java.io.InputStream"))
  477. }
  478. return cv
  479. }
  480. }
  481. type proxy_class_java_io_InputStream _seq.Ref
  482. func (p *proxy_class_java_io_InputStream) Bind_proxy_refnum__() int32 {
  483. return (*_seq.Ref)(p).Bind_IncNum()
  484. }
  485. func (p *proxy_class_java_io_InputStream) Read(a0 ...interface{}) (int32, error) {
  486. switch 0 + len(a0) {
  487. case 0:
  488. res := C.cproxy_java_io_InputStream_read__(C.jint(p.Bind_proxy_refnum__()))
  489. _res := int32(res.res)
  490. var _exc error
  491. _exc_ref := _seq.FromRefNum(int32(res.exc))
  492. if _exc_ref != nil {
  493. if res.exc < 0 { // go object
  494. _exc = _exc_ref.Get().(error)
  495. } else { // foreign object
  496. _exc = (*proxy_error)(_exc_ref)
  497. }
  498. }
  499. return _res, _exc
  500. case 1:
  501. _a0, ok0 := a0[0].([]byte)
  502. if ok0 {
  503. __a0 := fromSlice(_a0, false)
  504. res := C.cproxy_java_io_InputStream_read___3B(C.jint(p.Bind_proxy_refnum__()), __a0)
  505. _res := int32(res.res)
  506. var _exc error
  507. _exc_ref := _seq.FromRefNum(int32(res.exc))
  508. if _exc_ref != nil {
  509. if res.exc < 0 { // go object
  510. _exc = _exc_ref.Get().(error)
  511. } else { // foreign object
  512. _exc = (*proxy_error)(_exc_ref)
  513. }
  514. }
  515. return _res, _exc
  516. }
  517. case 3:
  518. _a0, ok0 := a0[0].([]byte)
  519. _a1, ok1 := a0[1].(int32)
  520. _a2, ok2 := a0[2].(int32)
  521. if ok0 && ok1 && ok2 {
  522. __a0 := fromSlice(_a0, false)
  523. __a1 := C.jint(_a1)
  524. __a2 := C.jint(_a2)
  525. res := C.cproxy_java_io_InputStream_read___3BII(C.jint(p.Bind_proxy_refnum__()), __a0, __a1, __a2)
  526. _res := int32(res.res)
  527. var _exc error
  528. _exc_ref := _seq.FromRefNum(int32(res.exc))
  529. if _exc_ref != nil {
  530. if res.exc < 0 { // go object
  531. _exc = _exc_ref.Get().(error)
  532. } else { // foreign object
  533. _exc = (*proxy_error)(_exc_ref)
  534. }
  535. }
  536. return _res, _exc
  537. }
  538. }
  539. panic("no overloaded method found for java.io.InputStream.read that matched the arguments")
  540. }
  541. func (p *proxy_class_java_io_InputStream) ToString() string {
  542. res := C.cproxy_java_io_InputStream_toString(C.jint(p.Bind_proxy_refnum__()))
  543. _res := decodeString(res.res)
  544. var _exc error
  545. _exc_ref := _seq.FromRefNum(int32(res.exc))
  546. if _exc_ref != nil {
  547. if res.exc < 0 { // go object
  548. _exc = _exc_ref.Get().(error)
  549. } else { // foreign object
  550. _exc = (*proxy_error)(_exc_ref)
  551. }
  552. }
  553. if _exc != nil {
  554. panic(_exc)
  555. }
  556. return _res
  557. }
  558. var class_java_util_concurrent_Future C.jclass
  559. func init_java_util_concurrent_Future() {
  560. cls := C.CString("java/util/concurrent/Future")
  561. clazz := C.go_seq_find_class(cls)
  562. C.free(unsafe.Pointer(cls))
  563. if uintptr(clazz) == 0 {
  564. return
  565. }
  566. class_java_util_concurrent_Future = clazz
  567. Future.Cast = func(v interface{}) Java.Java_util_concurrent_Future {
  568. t := reflect.TypeOf((*proxy_class_java_util_concurrent_Future)(nil))
  569. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_util_concurrent_Future)
  570. ref := C.jint(_seq.ToRefNum(cv))
  571. if C.go_seq_isinstanceof(ref, class_java_util_concurrent_Future) != 1 {
  572. panic(fmt.Errorf("%T is not an instance of %s", v, "java.util.concurrent.Future"))
  573. }
  574. return cv
  575. }
  576. }
  577. type proxy_class_java_util_concurrent_Future _seq.Ref
  578. func (p *proxy_class_java_util_concurrent_Future) Bind_proxy_refnum__() int32 {
  579. return (*_seq.Ref)(p).Bind_IncNum()
  580. }
  581. func (p *proxy_class_java_util_concurrent_Future) Get(a0 ...interface{}) (Java.Java_lang_Object, error) {
  582. switch 0 + len(a0) {
  583. case 0:
  584. res := C.cproxy_java_util_concurrent_Future_get__(C.jint(p.Bind_proxy_refnum__()))
  585. var _res Java.Java_lang_Object
  586. _res_ref := _seq.FromRefNum(int32(res.res))
  587. if _res_ref != nil {
  588. if res.res < 0 { // go object
  589. _res = _res_ref.Get().(Java.Java_lang_Object)
  590. } else { // foreign object
  591. _res = (*proxy_class_java_lang_Object)(_res_ref)
  592. }
  593. }
  594. var _exc error
  595. _exc_ref := _seq.FromRefNum(int32(res.exc))
  596. if _exc_ref != nil {
  597. if res.exc < 0 { // go object
  598. _exc = _exc_ref.Get().(error)
  599. } else { // foreign object
  600. _exc = (*proxy_error)(_exc_ref)
  601. }
  602. }
  603. return _res, _exc
  604. case 2:
  605. _a0, ok0 := a0[0].(int64)
  606. _a1, ok1 := a0[1].(Java.Java_util_concurrent_TimeUnit)
  607. if ok0 && ok1 {
  608. __a0 := C.jlong(_a0)
  609. var __a1 C.jint = _seq.NullRefNum
  610. if _a1 != nil {
  611. __a1 = C.jint(_seq.ToRefNum(_a1))
  612. }
  613. res := C.cproxy_java_util_concurrent_Future_get__JLjava_util_concurrent_TimeUnit_2(C.jint(p.Bind_proxy_refnum__()), __a0, __a1)
  614. var _res Java.Java_lang_Object
  615. _res_ref := _seq.FromRefNum(int32(res.res))
  616. if _res_ref != nil {
  617. if res.res < 0 { // go object
  618. _res = _res_ref.Get().(Java.Java_lang_Object)
  619. } else { // foreign object
  620. _res = (*proxy_class_java_lang_Object)(_res_ref)
  621. }
  622. }
  623. var _exc error
  624. _exc_ref := _seq.FromRefNum(int32(res.exc))
  625. if _exc_ref != nil {
  626. if res.exc < 0 { // go object
  627. _exc = _exc_ref.Get().(error)
  628. } else { // foreign object
  629. _exc = (*proxy_error)(_exc_ref)
  630. }
  631. }
  632. return _res, _exc
  633. }
  634. }
  635. panic("no overloaded method found for java.util.concurrent.Future.get that matched the arguments")
  636. }
  637. var class_java_lang_Object C.jclass
  638. func init_java_lang_Object() {
  639. cls := C.CString("java/lang/Object")
  640. clazz := C.go_seq_find_class(cls)
  641. C.free(unsafe.Pointer(cls))
  642. if uintptr(clazz) == 0 {
  643. return
  644. }
  645. class_java_lang_Object = clazz
  646. Object.Cast = func(v interface{}) Java.Java_lang_Object {
  647. t := reflect.TypeOf((*proxy_class_java_lang_Object)(nil))
  648. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Object)
  649. ref := C.jint(_seq.ToRefNum(cv))
  650. if C.go_seq_isinstanceof(ref, class_java_lang_Object) != 1 {
  651. panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Object"))
  652. }
  653. return cv
  654. }
  655. }
  656. type proxy_class_java_lang_Object _seq.Ref
  657. func (p *proxy_class_java_lang_Object) Bind_proxy_refnum__() int32 {
  658. return (*_seq.Ref)(p).Bind_IncNum()
  659. }
  660. func (p *proxy_class_java_lang_Object) ToString() string {
  661. res := C.cproxy_java_lang_Object_toString(C.jint(p.Bind_proxy_refnum__()))
  662. _res := decodeString(res.res)
  663. var _exc error
  664. _exc_ref := _seq.FromRefNum(int32(res.exc))
  665. if _exc_ref != nil {
  666. if res.exc < 0 { // go object
  667. _exc = _exc_ref.Get().(error)
  668. } else { // foreign object
  669. _exc = (*proxy_error)(_exc_ref)
  670. }
  671. }
  672. if _exc != nil {
  673. panic(_exc)
  674. }
  675. return _res
  676. }
  677. var class_java_util_concurrent_TimeUnit C.jclass
  678. func init_java_util_concurrent_TimeUnit() {
  679. cls := C.CString("java/util/concurrent/TimeUnit")
  680. clazz := C.go_seq_find_class(cls)
  681. C.free(unsafe.Pointer(cls))
  682. if uintptr(clazz) == 0 {
  683. return
  684. }
  685. class_java_util_concurrent_TimeUnit = clazz
  686. TimeUnit.Cast = func(v interface{}) Java.Java_util_concurrent_TimeUnit {
  687. t := reflect.TypeOf((*proxy_class_java_util_concurrent_TimeUnit)(nil))
  688. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_util_concurrent_TimeUnit)
  689. ref := C.jint(_seq.ToRefNum(cv))
  690. if C.go_seq_isinstanceof(ref, class_java_util_concurrent_TimeUnit) != 1 {
  691. panic(fmt.Errorf("%T is not an instance of %s", v, "java.util.concurrent.TimeUnit"))
  692. }
  693. return cv
  694. }
  695. }
  696. type proxy_class_java_util_concurrent_TimeUnit _seq.Ref
  697. func (p *proxy_class_java_util_concurrent_TimeUnit) Bind_proxy_refnum__() int32 {
  698. return (*_seq.Ref)(p).Bind_IncNum()
  699. }
  700. func (p *proxy_class_java_util_concurrent_TimeUnit) ToString() string {
  701. res := C.cproxy_java_util_concurrent_TimeUnit_toString(C.jint(p.Bind_proxy_refnum__()))
  702. _res := decodeString(res.res)
  703. var _exc error
  704. _exc_ref := _seq.FromRefNum(int32(res.exc))
  705. if _exc_ref != nil {
  706. if res.exc < 0 { // go object
  707. _exc = _exc_ref.Get().(error)
  708. } else { // foreign object
  709. _exc = (*proxy_error)(_exc_ref)
  710. }
  711. }
  712. if _exc != nil {
  713. panic(_exc)
  714. }
  715. return _res
  716. }
  717. var class_java_util_Spliterators C.jclass
  718. func init_java_util_Spliterators() {
  719. cls := C.CString("java/util/Spliterators")
  720. clazz := C.go_seq_find_class(cls)
  721. C.free(unsafe.Pointer(cls))
  722. if uintptr(clazz) == 0 {
  723. return
  724. }
  725. class_java_util_Spliterators = clazz
  726. Spliterators.Iterator = func(a0 Java.Java_util_Spliterator) Java.Java_util_Iterator {
  727. {
  728. var __a0 C.jint = _seq.NullRefNum
  729. if a0 != nil {
  730. __a0 = C.jint(_seq.ToRefNum(a0))
  731. }
  732. res := C.cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_2(__a0)
  733. var _res Java.Java_util_Iterator
  734. _res_ref := _seq.FromRefNum(int32(res.res))
  735. if _res_ref != nil {
  736. if res.res < 0 { // go object
  737. _res = _res_ref.Get().(Java.Java_util_Iterator)
  738. } else { // foreign object
  739. _res = (*proxy_class_java_util_Iterator)(_res_ref)
  740. }
  741. }
  742. var _exc error
  743. _exc_ref := _seq.FromRefNum(int32(res.exc))
  744. if _exc_ref != nil {
  745. if res.exc < 0 { // go object
  746. _exc = _exc_ref.Get().(error)
  747. } else { // foreign object
  748. _exc = (*proxy_error)(_exc_ref)
  749. }
  750. }
  751. if _exc != nil {
  752. panic(_exc)
  753. }
  754. return _res
  755. }
  756. {
  757. _a0, ok0 := a0.(Java.Java_util_Spliterator_OfInt)
  758. if ok0 {
  759. var __a0 C.jint = _seq.NullRefNum
  760. if _a0 != nil {
  761. __a0 = C.jint(_seq.ToRefNum(_a0))
  762. }
  763. res := C.cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfInt_2(__a0)
  764. var _res Java.Java_util_PrimitiveIterator_OfInt
  765. _res_ref := _seq.FromRefNum(int32(res.res))
  766. if _res_ref != nil {
  767. if res.res < 0 { // go object
  768. _res = _res_ref.Get().(Java.Java_util_PrimitiveIterator_OfInt)
  769. } else { // foreign object
  770. _res = (*proxy_class_java_util_PrimitiveIterator_OfInt)(_res_ref)
  771. }
  772. }
  773. var _exc error
  774. _exc_ref := _seq.FromRefNum(int32(res.exc))
  775. if _exc_ref != nil {
  776. if res.exc < 0 { // go object
  777. _exc = _exc_ref.Get().(error)
  778. } else { // foreign object
  779. _exc = (*proxy_error)(_exc_ref)
  780. }
  781. }
  782. if _exc != nil {
  783. panic(_exc)
  784. }
  785. return _res
  786. }
  787. }
  788. {
  789. _a0, ok0 := a0.(Java.Java_util_Spliterator_OfLong)
  790. if ok0 {
  791. var __a0 C.jint = _seq.NullRefNum
  792. if _a0 != nil {
  793. __a0 = C.jint(_seq.ToRefNum(_a0))
  794. }
  795. res := C.cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfLong_2(__a0)
  796. var _res Java.Java_util_PrimitiveIterator_OfLong
  797. _res_ref := _seq.FromRefNum(int32(res.res))
  798. if _res_ref != nil {
  799. if res.res < 0 { // go object
  800. _res = _res_ref.Get().(Java.Java_util_PrimitiveIterator_OfLong)
  801. } else { // foreign object
  802. _res = (*proxy_class_java_util_PrimitiveIterator_OfLong)(_res_ref)
  803. }
  804. }
  805. var _exc error
  806. _exc_ref := _seq.FromRefNum(int32(res.exc))
  807. if _exc_ref != nil {
  808. if res.exc < 0 { // go object
  809. _exc = _exc_ref.Get().(error)
  810. } else { // foreign object
  811. _exc = (*proxy_error)(_exc_ref)
  812. }
  813. }
  814. if _exc != nil {
  815. panic(_exc)
  816. }
  817. return _res
  818. }
  819. }
  820. {
  821. _a0, ok0 := a0.(Java.Java_util_Spliterator_OfDouble)
  822. if ok0 {
  823. var __a0 C.jint = _seq.NullRefNum
  824. if _a0 != nil {
  825. __a0 = C.jint(_seq.ToRefNum(_a0))
  826. }
  827. res := C.cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfDouble_2(__a0)
  828. var _res Java.Java_util_PrimitiveIterator_OfDouble
  829. _res_ref := _seq.FromRefNum(int32(res.res))
  830. if _res_ref != nil {
  831. if res.res < 0 { // go object
  832. _res = _res_ref.Get().(Java.Java_util_PrimitiveIterator_OfDouble)
  833. } else { // foreign object
  834. _res = (*proxy_class_java_util_PrimitiveIterator_OfDouble)(_res_ref)
  835. }
  836. }
  837. var _exc error
  838. _exc_ref := _seq.FromRefNum(int32(res.exc))
  839. if _exc_ref != nil {
  840. if res.exc < 0 { // go object
  841. _exc = _exc_ref.Get().(error)
  842. } else { // foreign object
  843. _exc = (*proxy_error)(_exc_ref)
  844. }
  845. }
  846. if _exc != nil {
  847. panic(_exc)
  848. }
  849. return _res
  850. }
  851. }
  852. panic("no overloaded method found for java.util.Spliterators.iterator that matched the arguments")
  853. }
  854. Spliterators.Cast = func(v interface{}) Java.Java_util_Spliterators {
  855. t := reflect.TypeOf((*proxy_class_java_util_Spliterators)(nil))
  856. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_util_Spliterators)
  857. ref := C.jint(_seq.ToRefNum(cv))
  858. if C.go_seq_isinstanceof(ref, class_java_util_Spliterators) != 1 {
  859. panic(fmt.Errorf("%T is not an instance of %s", v, "java.util.Spliterators"))
  860. }
  861. return cv
  862. }
  863. }
  864. type proxy_class_java_util_Spliterators _seq.Ref
  865. func (p *proxy_class_java_util_Spliterators) Bind_proxy_refnum__() int32 {
  866. return (*_seq.Ref)(p).Bind_IncNum()
  867. }
  868. func (p *proxy_class_java_util_Spliterators) ToString() string {
  869. res := C.cproxy_java_util_Spliterators_toString(C.jint(p.Bind_proxy_refnum__()))
  870. _res := decodeString(res.res)
  871. var _exc error
  872. _exc_ref := _seq.FromRefNum(int32(res.exc))
  873. if _exc_ref != nil {
  874. if res.exc < 0 { // go object
  875. _exc = _exc_ref.Get().(error)
  876. } else { // foreign object
  877. _exc = (*proxy_error)(_exc_ref)
  878. }
  879. }
  880. if _exc != nil {
  881. panic(_exc)
  882. }
  883. return _res
  884. }
  885. var class_java_lang_System C.jclass
  886. func init_java_lang_System() {
  887. cls := C.CString("java/lang/System")
  888. clazz := C.go_seq_find_class(cls)
  889. C.free(unsafe.Pointer(cls))
  890. if uintptr(clazz) == 0 {
  891. return
  892. }
  893. class_java_lang_System = clazz
  894. System.Console = func() Java.Java_io_Console {
  895. res := C.cproxy_s_java_lang_System_console()
  896. var _res Java.Java_io_Console
  897. _res_ref := _seq.FromRefNum(int32(res.res))
  898. if _res_ref != nil {
  899. if res.res < 0 { // go object
  900. _res = _res_ref.Get().(Java.Java_io_Console)
  901. } else { // foreign object
  902. _res = (*proxy_class_java_io_Console)(_res_ref)
  903. }
  904. }
  905. var _exc error
  906. _exc_ref := _seq.FromRefNum(int32(res.exc))
  907. if _exc_ref != nil {
  908. if res.exc < 0 { // go object
  909. _exc = _exc_ref.Get().(error)
  910. } else { // foreign object
  911. _exc = (*proxy_error)(_exc_ref)
  912. }
  913. }
  914. if _exc != nil {
  915. panic(_exc)
  916. }
  917. return _res
  918. }
  919. System.Cast = func(v interface{}) Java.Java_lang_System {
  920. t := reflect.TypeOf((*proxy_class_java_lang_System)(nil))
  921. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_System)
  922. ref := C.jint(_seq.ToRefNum(cv))
  923. if C.go_seq_isinstanceof(ref, class_java_lang_System) != 1 {
  924. panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.System"))
  925. }
  926. return cv
  927. }
  928. }
  929. type proxy_class_java_lang_System _seq.Ref
  930. func (p *proxy_class_java_lang_System) Bind_proxy_refnum__() int32 {
  931. return (*_seq.Ref)(p).Bind_IncNum()
  932. }
  933. func (p *proxy_class_java_lang_System) ToString() string {
  934. res := C.cproxy_java_lang_System_toString(C.jint(p.Bind_proxy_refnum__()))
  935. _res := decodeString(res.res)
  936. var _exc error
  937. _exc_ref := _seq.FromRefNum(int32(res.exc))
  938. if _exc_ref != nil {
  939. if res.exc < 0 { // go object
  940. _exc = _exc_ref.Get().(error)
  941. } else { // foreign object
  942. _exc = (*proxy_error)(_exc_ref)
  943. }
  944. }
  945. if _exc != nil {
  946. panic(_exc)
  947. }
  948. return _res
  949. }
  950. var class_java_Future C.jclass
  951. func init_java_Future() {
  952. cls := C.CString("java/Future")
  953. clazz := C.go_seq_find_class(cls)
  954. C.free(unsafe.Pointer(cls))
  955. if uintptr(clazz) == 0 {
  956. return
  957. }
  958. class_java_Future = clazz
  959. Future.Cast = func(v interface{}) Java.Java_Future {
  960. t := reflect.TypeOf((*proxy_class_java_Future)(nil))
  961. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_Future)
  962. ref := C.jint(_seq.ToRefNum(cv))
  963. if C.go_seq_isinstanceof(ref, class_java_Future) != 1 {
  964. panic(fmt.Errorf("%T is not an instance of %s", v, "java.Future"))
  965. }
  966. return cv
  967. }
  968. }
  969. type proxy_class_java_Future _seq.Ref
  970. func (p *proxy_class_java_Future) Bind_proxy_refnum__() int32 {
  971. return (*_seq.Ref)(p).Bind_IncNum()
  972. }
  973. func (p *proxy_class_java_Future) Get(a0 ...interface{}) (Java.Java_lang_Object, error) {
  974. switch 0 + len(a0) {
  975. case 0:
  976. res := C.cproxy_java_Future_get__(C.jint(p.Bind_proxy_refnum__()))
  977. var _res Java.Java_lang_Object
  978. _res_ref := _seq.FromRefNum(int32(res.res))
  979. if _res_ref != nil {
  980. if res.res < 0 { // go object
  981. _res = _res_ref.Get().(Java.Java_lang_Object)
  982. } else { // foreign object
  983. _res = (*proxy_class_java_lang_Object)(_res_ref)
  984. }
  985. }
  986. var _exc error
  987. _exc_ref := _seq.FromRefNum(int32(res.exc))
  988. if _exc_ref != nil {
  989. if res.exc < 0 { // go object
  990. _exc = _exc_ref.Get().(error)
  991. } else { // foreign object
  992. _exc = (*proxy_error)(_exc_ref)
  993. }
  994. }
  995. return _res, _exc
  996. case 2:
  997. _a0, ok0 := a0[0].(int64)
  998. _a1, ok1 := a0[1].(Java.Java_util_concurrent_TimeUnit)
  999. if ok0 && ok1 {
  1000. __a0 := C.jlong(_a0)
  1001. var __a1 C.jint = _seq.NullRefNum
  1002. if _a1 != nil {
  1003. __a1 = C.jint(_seq.ToRefNum(_a1))
  1004. }
  1005. res := C.cproxy_java_Future_get__JLjava_util_concurrent_TimeUnit_2(C.jint(p.Bind_proxy_refnum__()), __a0, __a1)
  1006. var _res Java.Java_lang_Object
  1007. _res_ref := _seq.FromRefNum(int32(res.res))
  1008. if _res_ref != nil {
  1009. if res.res < 0 { // go object
  1010. _res = _res_ref.Get().(Java.Java_lang_Object)
  1011. } else { // foreign object
  1012. _res = (*proxy_class_java_lang_Object)(_res_ref)
  1013. }
  1014. }
  1015. var _exc error
  1016. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1017. if _exc_ref != nil {
  1018. if res.exc < 0 { // go object
  1019. _exc = _exc_ref.Get().(error)
  1020. } else { // foreign object
  1021. _exc = (*proxy_error)(_exc_ref)
  1022. }
  1023. }
  1024. return _res, _exc
  1025. }
  1026. }
  1027. panic("no overloaded method found for java.Future.get that matched the arguments")
  1028. }
  1029. func (p *proxy_class_java_Future) Super() Java.Java_Future {
  1030. return &super_java_Future{p}
  1031. }
  1032. type super_java_Future struct{ *proxy_class_java_Future }
  1033. func (p *proxy_class_java_Future) Unwrap() interface{} {
  1034. goRefnum := C.go_seq_unwrap(C.jint(p.Bind_proxy_refnum__()))
  1035. return _seq.FromRefNum(int32(goRefnum)).Get().(*java.Future)
  1036. }
  1037. func (p *super_java_Future) Get(a0 ...interface{}) (Java.Java_lang_Object, error) {
  1038. switch 0 + len(a0) {
  1039. case 0:
  1040. res := C.csuper_java_Future_get__(C.jint(p.Bind_proxy_refnum__()))
  1041. var _res Java.Java_lang_Object
  1042. _res_ref := _seq.FromRefNum(int32(res.res))
  1043. if _res_ref != nil {
  1044. if res.res < 0 { // go object
  1045. _res = _res_ref.Get().(Java.Java_lang_Object)
  1046. } else { // foreign object
  1047. _res = (*proxy_class_java_lang_Object)(_res_ref)
  1048. }
  1049. }
  1050. var _exc error
  1051. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1052. if _exc_ref != nil {
  1053. if res.exc < 0 { // go object
  1054. _exc = _exc_ref.Get().(error)
  1055. } else { // foreign object
  1056. _exc = (*proxy_error)(_exc_ref)
  1057. }
  1058. }
  1059. return _res, _exc
  1060. case 2:
  1061. _a0, ok0 := a0[0].(int64)
  1062. _a1, ok1 := a0[1].(Java.Java_util_concurrent_TimeUnit)
  1063. if ok0 && ok1 {
  1064. __a0 := C.jlong(_a0)
  1065. var __a1 C.jint = _seq.NullRefNum
  1066. if _a1 != nil {
  1067. __a1 = C.jint(_seq.ToRefNum(_a1))
  1068. }
  1069. res := C.csuper_java_Future_get__JLjava_util_concurrent_TimeUnit_2(C.jint(p.Bind_proxy_refnum__()), __a0, __a1)
  1070. var _res Java.Java_lang_Object
  1071. _res_ref := _seq.FromRefNum(int32(res.res))
  1072. if _res_ref != nil {
  1073. if res.res < 0 { // go object
  1074. _res = _res_ref.Get().(Java.Java_lang_Object)
  1075. } else { // foreign object
  1076. _res = (*proxy_class_java_lang_Object)(_res_ref)
  1077. }
  1078. }
  1079. var _exc error
  1080. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1081. if _exc_ref != nil {
  1082. if res.exc < 0 { // go object
  1083. _exc = _exc_ref.Get().(error)
  1084. } else { // foreign object
  1085. _exc = (*proxy_error)(_exc_ref)
  1086. }
  1087. }
  1088. return _res, _exc
  1089. }
  1090. }
  1091. panic("no overloaded method found for java.Future.get that matched the arguments")
  1092. }
  1093. var class_java_InputStream C.jclass
  1094. func init_java_InputStream() {
  1095. cls := C.CString("java/InputStream")
  1096. clazz := C.go_seq_find_class(cls)
  1097. C.free(unsafe.Pointer(cls))
  1098. if uintptr(clazz) == 0 {
  1099. return
  1100. }
  1101. class_java_InputStream = clazz
  1102. InputStream.Cast = func(v interface{}) Java.Java_InputStream {
  1103. t := reflect.TypeOf((*proxy_class_java_InputStream)(nil))
  1104. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_InputStream)
  1105. ref := C.jint(_seq.ToRefNum(cv))
  1106. if C.go_seq_isinstanceof(ref, class_java_InputStream) != 1 {
  1107. panic(fmt.Errorf("%T is not an instance of %s", v, "java.InputStream"))
  1108. }
  1109. return cv
  1110. }
  1111. }
  1112. type proxy_class_java_InputStream _seq.Ref
  1113. func (p *proxy_class_java_InputStream) Bind_proxy_refnum__() int32 {
  1114. return (*_seq.Ref)(p).Bind_IncNum()
  1115. }
  1116. func (p *proxy_class_java_InputStream) Read(a0 ...interface{}) (int32, error) {
  1117. switch 0 + len(a0) {
  1118. case 0:
  1119. res := C.cproxy_java_InputStream_read__(C.jint(p.Bind_proxy_refnum__()))
  1120. _res := int32(res.res)
  1121. var _exc error
  1122. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1123. if _exc_ref != nil {
  1124. if res.exc < 0 { // go object
  1125. _exc = _exc_ref.Get().(error)
  1126. } else { // foreign object
  1127. _exc = (*proxy_error)(_exc_ref)
  1128. }
  1129. }
  1130. return _res, _exc
  1131. case 1:
  1132. _a0, ok0 := a0[0].([]byte)
  1133. if ok0 {
  1134. __a0 := fromSlice(_a0, false)
  1135. res := C.cproxy_java_InputStream_read___3B(C.jint(p.Bind_proxy_refnum__()), __a0)
  1136. _res := int32(res.res)
  1137. var _exc error
  1138. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1139. if _exc_ref != nil {
  1140. if res.exc < 0 { // go object
  1141. _exc = _exc_ref.Get().(error)
  1142. } else { // foreign object
  1143. _exc = (*proxy_error)(_exc_ref)
  1144. }
  1145. }
  1146. return _res, _exc
  1147. }
  1148. case 3:
  1149. _a0, ok0 := a0[0].([]byte)
  1150. _a1, ok1 := a0[1].(int32)
  1151. _a2, ok2 := a0[2].(int32)
  1152. if ok0 && ok1 && ok2 {
  1153. __a0 := fromSlice(_a0, false)
  1154. __a1 := C.jint(_a1)
  1155. __a2 := C.jint(_a2)
  1156. res := C.cproxy_java_InputStream_read___3BII(C.jint(p.Bind_proxy_refnum__()), __a0, __a1, __a2)
  1157. _res := int32(res.res)
  1158. var _exc error
  1159. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1160. if _exc_ref != nil {
  1161. if res.exc < 0 { // go object
  1162. _exc = _exc_ref.Get().(error)
  1163. } else { // foreign object
  1164. _exc = (*proxy_error)(_exc_ref)
  1165. }
  1166. }
  1167. return _res, _exc
  1168. }
  1169. }
  1170. panic("no overloaded method found for java.InputStream.read that matched the arguments")
  1171. }
  1172. func (p *proxy_class_java_InputStream) ToString() string {
  1173. res := C.cproxy_java_InputStream_toString(C.jint(p.Bind_proxy_refnum__()))
  1174. _res := decodeString(res.res)
  1175. var _exc error
  1176. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1177. if _exc_ref != nil {
  1178. if res.exc < 0 { // go object
  1179. _exc = _exc_ref.Get().(error)
  1180. } else { // foreign object
  1181. _exc = (*proxy_error)(_exc_ref)
  1182. }
  1183. }
  1184. if _exc != nil {
  1185. panic(_exc)
  1186. }
  1187. return _res
  1188. }
  1189. func (p *proxy_class_java_InputStream) Super() Java.Java_InputStream {
  1190. return &super_java_InputStream{p}
  1191. }
  1192. type super_java_InputStream struct{ *proxy_class_java_InputStream }
  1193. func (p *proxy_class_java_InputStream) Unwrap() interface{} {
  1194. goRefnum := C.go_seq_unwrap(C.jint(p.Bind_proxy_refnum__()))
  1195. return _seq.FromRefNum(int32(goRefnum)).Get().(*java.InputStream)
  1196. }
  1197. func (p *super_java_InputStream) Read(a0 ...interface{}) (int32, error) {
  1198. switch 0 + len(a0) {
  1199. case 0:
  1200. res := C.csuper_java_InputStream_read__(C.jint(p.Bind_proxy_refnum__()))
  1201. _res := int32(res.res)
  1202. var _exc error
  1203. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1204. if _exc_ref != nil {
  1205. if res.exc < 0 { // go object
  1206. _exc = _exc_ref.Get().(error)
  1207. } else { // foreign object
  1208. _exc = (*proxy_error)(_exc_ref)
  1209. }
  1210. }
  1211. return _res, _exc
  1212. case 1:
  1213. _a0, ok0 := a0[0].([]byte)
  1214. if ok0 {
  1215. __a0 := fromSlice(_a0, false)
  1216. res := C.csuper_java_InputStream_read___3B(C.jint(p.Bind_proxy_refnum__()), __a0)
  1217. _res := int32(res.res)
  1218. var _exc error
  1219. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1220. if _exc_ref != nil {
  1221. if res.exc < 0 { // go object
  1222. _exc = _exc_ref.Get().(error)
  1223. } else { // foreign object
  1224. _exc = (*proxy_error)(_exc_ref)
  1225. }
  1226. }
  1227. return _res, _exc
  1228. }
  1229. case 3:
  1230. _a0, ok0 := a0[0].([]byte)
  1231. _a1, ok1 := a0[1].(int32)
  1232. _a2, ok2 := a0[2].(int32)
  1233. if ok0 && ok1 && ok2 {
  1234. __a0 := fromSlice(_a0, false)
  1235. __a1 := C.jint(_a1)
  1236. __a2 := C.jint(_a2)
  1237. res := C.csuper_java_InputStream_read___3BII(C.jint(p.Bind_proxy_refnum__()), __a0, __a1, __a2)
  1238. _res := int32(res.res)
  1239. var _exc error
  1240. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1241. if _exc_ref != nil {
  1242. if res.exc < 0 { // go object
  1243. _exc = _exc_ref.Get().(error)
  1244. } else { // foreign object
  1245. _exc = (*proxy_error)(_exc_ref)
  1246. }
  1247. }
  1248. return _res, _exc
  1249. }
  1250. }
  1251. panic("no overloaded method found for java.InputStream.read that matched the arguments")
  1252. }
  1253. func (p *super_java_InputStream) ToString() string {
  1254. res := C.csuper_java_InputStream_toString(C.jint(p.Bind_proxy_refnum__()))
  1255. _res := decodeString(res.res)
  1256. var _exc error
  1257. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1258. if _exc_ref != nil {
  1259. if res.exc < 0 { // go object
  1260. _exc = _exc_ref.Get().(error)
  1261. } else { // foreign object
  1262. _exc = (*proxy_error)(_exc_ref)
  1263. }
  1264. }
  1265. if _exc != nil {
  1266. panic(_exc)
  1267. }
  1268. return _res
  1269. }
  1270. var class_java_Object C.jclass
  1271. func init_java_Object() {
  1272. cls := C.CString("java/Object")
  1273. clazz := C.go_seq_find_class(cls)
  1274. C.free(unsafe.Pointer(cls))
  1275. if uintptr(clazz) == 0 {
  1276. return
  1277. }
  1278. class_java_Object = clazz
  1279. Object.Cast = func(v interface{}) Java.Java_Object {
  1280. t := reflect.TypeOf((*proxy_class_java_Object)(nil))
  1281. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_Object)
  1282. ref := C.jint(_seq.ToRefNum(cv))
  1283. if C.go_seq_isinstanceof(ref, class_java_Object) != 1 {
  1284. panic(fmt.Errorf("%T is not an instance of %s", v, "java.Object"))
  1285. }
  1286. return cv
  1287. }
  1288. }
  1289. type proxy_class_java_Object _seq.Ref
  1290. func (p *proxy_class_java_Object) Bind_proxy_refnum__() int32 {
  1291. return (*_seq.Ref)(p).Bind_IncNum()
  1292. }
  1293. func (p *proxy_class_java_Object) ToString() string {
  1294. res := C.cproxy_java_Object_toString(C.jint(p.Bind_proxy_refnum__()))
  1295. _res := decodeString(res.res)
  1296. var _exc error
  1297. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1298. if _exc_ref != nil {
  1299. if res.exc < 0 { // go object
  1300. _exc = _exc_ref.Get().(error)
  1301. } else { // foreign object
  1302. _exc = (*proxy_error)(_exc_ref)
  1303. }
  1304. }
  1305. if _exc != nil {
  1306. panic(_exc)
  1307. }
  1308. return _res
  1309. }
  1310. func (p *proxy_class_java_Object) Super() Java.Java_Object {
  1311. return &super_java_Object{p}
  1312. }
  1313. type super_java_Object struct{ *proxy_class_java_Object }
  1314. func (p *proxy_class_java_Object) Unwrap() interface{} {
  1315. goRefnum := C.go_seq_unwrap(C.jint(p.Bind_proxy_refnum__()))
  1316. return _seq.FromRefNum(int32(goRefnum)).Get().(*java.Object)
  1317. }
  1318. func (p *super_java_Object) ToString() string {
  1319. res := C.csuper_java_Object_toString(C.jint(p.Bind_proxy_refnum__()))
  1320. _res := decodeString(res.res)
  1321. var _exc error
  1322. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1323. if _exc_ref != nil {
  1324. if res.exc < 0 { // go object
  1325. _exc = _exc_ref.Get().(error)
  1326. } else { // foreign object
  1327. _exc = (*proxy_error)(_exc_ref)
  1328. }
  1329. }
  1330. if _exc != nil {
  1331. panic(_exc)
  1332. }
  1333. return _res
  1334. }
  1335. var class_java_Runnable C.jclass
  1336. func init_java_Runnable() {
  1337. cls := C.CString("java/Runnable")
  1338. clazz := C.go_seq_find_class(cls)
  1339. C.free(unsafe.Pointer(cls))
  1340. if uintptr(clazz) == 0 {
  1341. return
  1342. }
  1343. class_java_Runnable = clazz
  1344. Runnable.Cast = func(v interface{}) Java.Java_Runnable {
  1345. t := reflect.TypeOf((*proxy_class_java_Runnable)(nil))
  1346. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_Runnable)
  1347. ref := C.jint(_seq.ToRefNum(cv))
  1348. if C.go_seq_isinstanceof(ref, class_java_Runnable) != 1 {
  1349. panic(fmt.Errorf("%T is not an instance of %s", v, "java.Runnable"))
  1350. }
  1351. return cv
  1352. }
  1353. }
  1354. type proxy_class_java_Runnable _seq.Ref
  1355. func (p *proxy_class_java_Runnable) Bind_proxy_refnum__() int32 {
  1356. return (*_seq.Ref)(p).Bind_IncNum()
  1357. }
  1358. func (p *proxy_class_java_Runnable) Run() {
  1359. res := C.cproxy_java_Runnable_run(C.jint(p.Bind_proxy_refnum__()))
  1360. var _exc error
  1361. _exc_ref := _seq.FromRefNum(int32(res))
  1362. if _exc_ref != nil {
  1363. if res < 0 { // go object
  1364. _exc = _exc_ref.Get().(error)
  1365. } else { // foreign object
  1366. _exc = (*proxy_error)(_exc_ref)
  1367. }
  1368. }
  1369. if _exc != nil {
  1370. panic(_exc)
  1371. }
  1372. }
  1373. func (p *proxy_class_java_Runnable) Super() Java.Java_Runnable {
  1374. return &super_java_Runnable{p}
  1375. }
  1376. type super_java_Runnable struct{ *proxy_class_java_Runnable }
  1377. func (p *proxy_class_java_Runnable) Unwrap() interface{} {
  1378. goRefnum := C.go_seq_unwrap(C.jint(p.Bind_proxy_refnum__()))
  1379. return _seq.FromRefNum(int32(goRefnum)).Get().(*java.Runnable)
  1380. }
  1381. func (p *super_java_Runnable) Run() {
  1382. res := C.csuper_java_Runnable_run(C.jint(p.Bind_proxy_refnum__()))
  1383. var _exc error
  1384. _exc_ref := _seq.FromRefNum(int32(res))
  1385. if _exc_ref != nil {
  1386. if res < 0 { // go object
  1387. _exc = _exc_ref.Get().(error)
  1388. } else { // foreign object
  1389. _exc = (*proxy_error)(_exc_ref)
  1390. }
  1391. }
  1392. if _exc != nil {
  1393. panic(_exc)
  1394. }
  1395. }
  1396. var class_java_util_Iterator C.jclass
  1397. func init_java_util_Iterator() {
  1398. cls := C.CString("java/util/Iterator")
  1399. clazz := C.go_seq_find_class(cls)
  1400. C.free(unsafe.Pointer(cls))
  1401. if uintptr(clazz) == 0 {
  1402. return
  1403. }
  1404. class_java_util_Iterator = clazz
  1405. Iterator.Cast = func(v interface{}) Java.Java_util_Iterator {
  1406. t := reflect.TypeOf((*proxy_class_java_util_Iterator)(nil))
  1407. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_util_Iterator)
  1408. ref := C.jint(_seq.ToRefNum(cv))
  1409. if C.go_seq_isinstanceof(ref, class_java_util_Iterator) != 1 {
  1410. panic(fmt.Errorf("%T is not an instance of %s", v, "java.util.Iterator"))
  1411. }
  1412. return cv
  1413. }
  1414. }
  1415. type proxy_class_java_util_Iterator _seq.Ref
  1416. func (p *proxy_class_java_util_Iterator) Bind_proxy_refnum__() int32 {
  1417. return (*_seq.Ref)(p).Bind_IncNum()
  1418. }
  1419. var class_java_util_Spliterator C.jclass
  1420. func init_java_util_Spliterator() {
  1421. cls := C.CString("java/util/Spliterator")
  1422. clazz := C.go_seq_find_class(cls)
  1423. C.free(unsafe.Pointer(cls))
  1424. if uintptr(clazz) == 0 {
  1425. return
  1426. }
  1427. class_java_util_Spliterator = clazz
  1428. Spliterator.Cast = func(v interface{}) Java.Java_util_Spliterator {
  1429. t := reflect.TypeOf((*proxy_class_java_util_Spliterator)(nil))
  1430. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_util_Spliterator)
  1431. ref := C.jint(_seq.ToRefNum(cv))
  1432. if C.go_seq_isinstanceof(ref, class_java_util_Spliterator) != 1 {
  1433. panic(fmt.Errorf("%T is not an instance of %s", v, "java.util.Spliterator"))
  1434. }
  1435. return cv
  1436. }
  1437. }
  1438. type proxy_class_java_util_Spliterator _seq.Ref
  1439. func (p *proxy_class_java_util_Spliterator) Bind_proxy_refnum__() int32 {
  1440. return (*_seq.Ref)(p).Bind_IncNum()
  1441. }
  1442. var class_java_util_PrimitiveIterator_OfInt C.jclass
  1443. func init_java_util_PrimitiveIterator_OfInt() {
  1444. cls := C.CString("java/util/PrimitiveIterator$OfInt")
  1445. clazz := C.go_seq_find_class(cls)
  1446. C.free(unsafe.Pointer(cls))
  1447. if uintptr(clazz) == 0 {
  1448. return
  1449. }
  1450. class_java_util_PrimitiveIterator_OfInt = clazz
  1451. OfInt.Cast = func(v interface{}) Java.Java_util_PrimitiveIterator_OfInt {
  1452. t := reflect.TypeOf((*proxy_class_java_util_PrimitiveIterator_OfInt)(nil))
  1453. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_util_PrimitiveIterator_OfInt)
  1454. ref := C.jint(_seq.ToRefNum(cv))
  1455. if C.go_seq_isinstanceof(ref, class_java_util_PrimitiveIterator_OfInt) != 1 {
  1456. panic(fmt.Errorf("%T is not an instance of %s", v, "java.util.PrimitiveIterator.OfInt"))
  1457. }
  1458. return cv
  1459. }
  1460. }
  1461. type proxy_class_java_util_PrimitiveIterator_OfInt _seq.Ref
  1462. func (p *proxy_class_java_util_PrimitiveIterator_OfInt) Bind_proxy_refnum__() int32 {
  1463. return (*_seq.Ref)(p).Bind_IncNum()
  1464. }
  1465. var class_java_util_Spliterator_OfInt C.jclass
  1466. func init_java_util_Spliterator_OfInt() {
  1467. cls := C.CString("java/util/Spliterator$OfInt")
  1468. clazz := C.go_seq_find_class(cls)
  1469. C.free(unsafe.Pointer(cls))
  1470. if uintptr(clazz) == 0 {
  1471. return
  1472. }
  1473. class_java_util_Spliterator_OfInt = clazz
  1474. OfInt.Cast = func(v interface{}) Java.Java_util_Spliterator_OfInt {
  1475. t := reflect.TypeOf((*proxy_class_java_util_Spliterator_OfInt)(nil))
  1476. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_util_Spliterator_OfInt)
  1477. ref := C.jint(_seq.ToRefNum(cv))
  1478. if C.go_seq_isinstanceof(ref, class_java_util_Spliterator_OfInt) != 1 {
  1479. panic(fmt.Errorf("%T is not an instance of %s", v, "java.util.Spliterator.OfInt"))
  1480. }
  1481. return cv
  1482. }
  1483. }
  1484. type proxy_class_java_util_Spliterator_OfInt _seq.Ref
  1485. func (p *proxy_class_java_util_Spliterator_OfInt) Bind_proxy_refnum__() int32 {
  1486. return (*_seq.Ref)(p).Bind_IncNum()
  1487. }
  1488. var class_java_util_PrimitiveIterator_OfLong C.jclass
  1489. func init_java_util_PrimitiveIterator_OfLong() {
  1490. cls := C.CString("java/util/PrimitiveIterator$OfLong")
  1491. clazz := C.go_seq_find_class(cls)
  1492. C.free(unsafe.Pointer(cls))
  1493. if uintptr(clazz) == 0 {
  1494. return
  1495. }
  1496. class_java_util_PrimitiveIterator_OfLong = clazz
  1497. OfLong.Cast = func(v interface{}) Java.Java_util_PrimitiveIterator_OfLong {
  1498. t := reflect.TypeOf((*proxy_class_java_util_PrimitiveIterator_OfLong)(nil))
  1499. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_util_PrimitiveIterator_OfLong)
  1500. ref := C.jint(_seq.ToRefNum(cv))
  1501. if C.go_seq_isinstanceof(ref, class_java_util_PrimitiveIterator_OfLong) != 1 {
  1502. panic(fmt.Errorf("%T is not an instance of %s", v, "java.util.PrimitiveIterator.OfLong"))
  1503. }
  1504. return cv
  1505. }
  1506. }
  1507. type proxy_class_java_util_PrimitiveIterator_OfLong _seq.Ref
  1508. func (p *proxy_class_java_util_PrimitiveIterator_OfLong) Bind_proxy_refnum__() int32 {
  1509. return (*_seq.Ref)(p).Bind_IncNum()
  1510. }
  1511. var class_java_util_Spliterator_OfLong C.jclass
  1512. func init_java_util_Spliterator_OfLong() {
  1513. cls := C.CString("java/util/Spliterator$OfLong")
  1514. clazz := C.go_seq_find_class(cls)
  1515. C.free(unsafe.Pointer(cls))
  1516. if uintptr(clazz) == 0 {
  1517. return
  1518. }
  1519. class_java_util_Spliterator_OfLong = clazz
  1520. OfLong.Cast = func(v interface{}) Java.Java_util_Spliterator_OfLong {
  1521. t := reflect.TypeOf((*proxy_class_java_util_Spliterator_OfLong)(nil))
  1522. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_util_Spliterator_OfLong)
  1523. ref := C.jint(_seq.ToRefNum(cv))
  1524. if C.go_seq_isinstanceof(ref, class_java_util_Spliterator_OfLong) != 1 {
  1525. panic(fmt.Errorf("%T is not an instance of %s", v, "java.util.Spliterator.OfLong"))
  1526. }
  1527. return cv
  1528. }
  1529. }
  1530. type proxy_class_java_util_Spliterator_OfLong _seq.Ref
  1531. func (p *proxy_class_java_util_Spliterator_OfLong) Bind_proxy_refnum__() int32 {
  1532. return (*_seq.Ref)(p).Bind_IncNum()
  1533. }
  1534. var class_java_util_PrimitiveIterator_OfDouble C.jclass
  1535. func init_java_util_PrimitiveIterator_OfDouble() {
  1536. cls := C.CString("java/util/PrimitiveIterator$OfDouble")
  1537. clazz := C.go_seq_find_class(cls)
  1538. C.free(unsafe.Pointer(cls))
  1539. if uintptr(clazz) == 0 {
  1540. return
  1541. }
  1542. class_java_util_PrimitiveIterator_OfDouble = clazz
  1543. OfDouble.Cast = func(v interface{}) Java.Java_util_PrimitiveIterator_OfDouble {
  1544. t := reflect.TypeOf((*proxy_class_java_util_PrimitiveIterator_OfDouble)(nil))
  1545. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_util_PrimitiveIterator_OfDouble)
  1546. ref := C.jint(_seq.ToRefNum(cv))
  1547. if C.go_seq_isinstanceof(ref, class_java_util_PrimitiveIterator_OfDouble) != 1 {
  1548. panic(fmt.Errorf("%T is not an instance of %s", v, "java.util.PrimitiveIterator.OfDouble"))
  1549. }
  1550. return cv
  1551. }
  1552. }
  1553. type proxy_class_java_util_PrimitiveIterator_OfDouble _seq.Ref
  1554. func (p *proxy_class_java_util_PrimitiveIterator_OfDouble) Bind_proxy_refnum__() int32 {
  1555. return (*_seq.Ref)(p).Bind_IncNum()
  1556. }
  1557. var class_java_util_Spliterator_OfDouble C.jclass
  1558. func init_java_util_Spliterator_OfDouble() {
  1559. cls := C.CString("java/util/Spliterator$OfDouble")
  1560. clazz := C.go_seq_find_class(cls)
  1561. C.free(unsafe.Pointer(cls))
  1562. if uintptr(clazz) == 0 {
  1563. return
  1564. }
  1565. class_java_util_Spliterator_OfDouble = clazz
  1566. OfDouble.Cast = func(v interface{}) Java.Java_util_Spliterator_OfDouble {
  1567. t := reflect.TypeOf((*proxy_class_java_util_Spliterator_OfDouble)(nil))
  1568. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_util_Spliterator_OfDouble)
  1569. ref := C.jint(_seq.ToRefNum(cv))
  1570. if C.go_seq_isinstanceof(ref, class_java_util_Spliterator_OfDouble) != 1 {
  1571. panic(fmt.Errorf("%T is not an instance of %s", v, "java.util.Spliterator.OfDouble"))
  1572. }
  1573. return cv
  1574. }
  1575. }
  1576. type proxy_class_java_util_Spliterator_OfDouble _seq.Ref
  1577. func (p *proxy_class_java_util_Spliterator_OfDouble) Bind_proxy_refnum__() int32 {
  1578. return (*_seq.Ref)(p).Bind_IncNum()
  1579. }
  1580. var class_java_io_Console C.jclass
  1581. func init_java_io_Console() {
  1582. cls := C.CString("java/io/Console")
  1583. clazz := C.go_seq_find_class(cls)
  1584. C.free(unsafe.Pointer(cls))
  1585. if uintptr(clazz) == 0 {
  1586. return
  1587. }
  1588. class_java_io_Console = clazz
  1589. Console.Cast = func(v interface{}) Java.Java_io_Console {
  1590. t := reflect.TypeOf((*proxy_class_java_io_Console)(nil))
  1591. cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_io_Console)
  1592. ref := C.jint(_seq.ToRefNum(cv))
  1593. if C.go_seq_isinstanceof(ref, class_java_io_Console) != 1 {
  1594. panic(fmt.Errorf("%T is not an instance of %s", v, "java.io.Console"))
  1595. }
  1596. return cv
  1597. }
  1598. }
  1599. type proxy_class_java_io_Console _seq.Ref
  1600. func (p *proxy_class_java_io_Console) Bind_proxy_refnum__() int32 {
  1601. return (*_seq.Ref)(p).Bind_IncNum()
  1602. }
  1603. func (p *proxy_class_java_io_Console) Flush() error {
  1604. res := C.cproxy_java_io_Console_flush(C.jint(p.Bind_proxy_refnum__()))
  1605. var _exc error
  1606. _exc_ref := _seq.FromRefNum(int32(res))
  1607. if _exc_ref != nil {
  1608. if res < 0 { // go object
  1609. _exc = _exc_ref.Get().(error)
  1610. } else { // foreign object
  1611. _exc = (*proxy_error)(_exc_ref)
  1612. }
  1613. }
  1614. return _exc
  1615. }
  1616. func (p *proxy_class_java_io_Console) ToString() string {
  1617. res := C.cproxy_java_io_Console_toString(C.jint(p.Bind_proxy_refnum__()))
  1618. _res := decodeString(res.res)
  1619. var _exc error
  1620. _exc_ref := _seq.FromRefNum(int32(res.exc))
  1621. if _exc_ref != nil {
  1622. if res.exc < 0 { // go object
  1623. _exc = _exc_ref.Get().(error)
  1624. } else { // foreign object
  1625. _exc = (*proxy_error)(_exc_ref)
  1626. }
  1627. }
  1628. if _exc != nil {
  1629. panic(_exc)
  1630. }
  1631. return _res
  1632. }
  1633. // Code generated by gobind. DO NOT EDIT.
  1634. // Package main is an autogenerated binder stub for package java.
  1635. //
  1636. // autogenerated by gobind -lang=go classes
  1637. package main
  1638. /*
  1639. #include <stdlib.h>
  1640. #include <stdint.h>
  1641. #include "seq.h"
  1642. #include "java.h"
  1643. */
  1644. import "C"
  1645. import (
  1646. java_1 "Java/java"
  1647. "Java/java/io"
  1648. "Java/java/lang"
  1649. "Java/java/util/concurrent"
  1650. "classes"
  1651. _seq "golang.org/x/mobile/bind/seq"
  1652. )
  1653. // suppress the error if seq ends up unused
  1654. var _ = _seq.FromRefNum
  1655. //export proxyjava_Future_Future_Set
  1656. func proxyjava_Future_Future_Set(refnum C.int32_t, v C.int32_t) {
  1657. ref := _seq.FromRefNum(int32(refnum))
  1658. var _v concurrent.Future
  1659. _v_ref := _seq.FromRefNum(int32(v))
  1660. if _v_ref != nil {
  1661. if v < 0 { // go object
  1662. _v = _v_ref.Get().(concurrent.Future)
  1663. } else { // foreign object
  1664. _v = (*proxy_class_java_util_concurrent_Future)(_v_ref)
  1665. }
  1666. }
  1667. ref.Get().(*java.Future).Future = _v
  1668. }
  1669. //export proxyjava_Future_Future_Get
  1670. func proxyjava_Future_Future_Get(refnum C.int32_t) C.int32_t {
  1671. ref := _seq.FromRefNum(int32(refnum))
  1672. v := ref.Get().(*java.Future).Future
  1673. var _v C.int32_t = _seq.NullRefNum
  1674. if v != nil {
  1675. _v = C.int32_t(_seq.ToRefNum(v))
  1676. }
  1677. return _v
  1678. }
  1679. //export proxyjava_Future_Get
  1680. func proxyjava_Future_Get(refnum C.int32_t) (C.int32_t, C.int32_t) {
  1681. ref := _seq.FromRefNum(int32(refnum))
  1682. v := ref.Get().(*java.Future)
  1683. res_0, res_1 := v.Get()
  1684. var _res_0 C.int32_t = _seq.NullRefNum
  1685. if res_0 != nil {
  1686. _res_0 = C.int32_t(_seq.ToRefNum(res_0))
  1687. }
  1688. var _res_1 C.int32_t = _seq.NullRefNum
  1689. if res_1 != nil {
  1690. _res_1 = C.int32_t(_seq.ToRefNum(res_1))
  1691. }
  1692. return _res_0, _res_1
  1693. }
  1694. //export proxyjava_Future_Get_
  1695. func proxyjava_Future_Get_(refnum C.int32_t, param_p0 C.int64_t, param_p1 C.int32_t) (C.int32_t, C.int32_t) {
  1696. ref := _seq.FromRefNum(int32(refnum))
  1697. v := ref.Get().(*java.Future)
  1698. _param_p0 := int64(param_p0)
  1699. var _param_p1 concurrent.TimeUnit
  1700. _param_p1_ref := _seq.FromRefNum(int32(param_p1))
  1701. if _param_p1_ref != nil {
  1702. if param_p1 < 0 { // go object
  1703. _param_p1 = _param_p1_ref.Get().(concurrent.TimeUnit)
  1704. } else { // foreign object
  1705. _param_p1 = (*proxy_class_java_util_concurrent_TimeUnit)(_param_p1_ref)
  1706. }
  1707. }
  1708. res_0, res_1 := v.Get_(_param_p0, _param_p1)
  1709. var _res_0 C.int32_t = _seq.NullRefNum
  1710. if res_0 != nil {
  1711. _res_0 = C.int32_t(_seq.ToRefNum(res_0))
  1712. }
  1713. var _res_1 C.int32_t = _seq.NullRefNum
  1714. if res_1 != nil {
  1715. _res_1 = C.int32_t(_seq.ToRefNum(res_1))
  1716. }
  1717. return _res_0, _res_1
  1718. }
  1719. //export new_java_Future
  1720. func new_java_Future() C.int32_t {
  1721. return C.int32_t(_seq.ToRefNum(new(java.Future)))
  1722. }
  1723. //export proxyjava_InputStream_InputStream_Set
  1724. func proxyjava_InputStream_InputStream_Set(refnum C.int32_t, v C.int32_t) {
  1725. ref := _seq.FromRefNum(int32(refnum))
  1726. var _v io.InputStream
  1727. _v_ref := _seq.FromRefNum(int32(v))
  1728. if _v_ref != nil {
  1729. if v < 0 { // go object
  1730. _v = _v_ref.Get().(io.InputStream)
  1731. } else { // foreign object
  1732. _v = (*proxy_class_java_io_InputStream)(_v_ref)
  1733. }
  1734. }
  1735. ref.Get().(*java.InputStream).InputStream = _v
  1736. }
  1737. //export proxyjava_InputStream_InputStream_Get
  1738. func proxyjava_InputStream_InputStream_Get(refnum C.int32_t) C.int32_t {
  1739. ref := _seq.FromRefNum(int32(refnum))
  1740. v := ref.Get().(*java.InputStream).InputStream
  1741. var _v C.int32_t = _seq.NullRefNum
  1742. if v != nil {
  1743. _v = C.int32_t(_seq.ToRefNum(v))
  1744. }
  1745. return _v
  1746. }
  1747. //export proxyjava_InputStream_Read
  1748. func proxyjava_InputStream_Read(refnum C.int32_t) (C.int32_t, C.int32_t) {
  1749. ref := _seq.FromRefNum(int32(refnum))
  1750. v := ref.Get().(*java.InputStream)
  1751. res_0, res_1 := v.Read()
  1752. _res_0 := C.int32_t(res_0)
  1753. var _res_1 C.int32_t = _seq.NullRefNum
  1754. if res_1 != nil {
  1755. _res_1 = C.int32_t(_seq.ToRefNum(res_1))
  1756. }
  1757. return _res_0, _res_1
  1758. }
  1759. //export new_java_InputStream
  1760. func new_java_InputStream() C.int32_t {
  1761. return C.int32_t(_seq.ToRefNum(new(java.InputStream)))
  1762. }
  1763. //export proxyjava_Object_Object_Set
  1764. func proxyjava_Object_Object_Set(refnum C.int32_t, v C.int32_t) {
  1765. ref := _seq.FromRefNum(int32(refnum))
  1766. var _v lang.Object
  1767. _v_ref := _seq.FromRefNum(int32(v))
  1768. if _v_ref != nil {
  1769. if v < 0 { // go object
  1770. _v = _v_ref.Get().(lang.Object)
  1771. } else { // foreign object
  1772. _v = (*proxy_class_java_lang_Object)(_v_ref)
  1773. }
  1774. }
  1775. ref.Get().(*java.Object).Object = _v
  1776. }
  1777. //export proxyjava_Object_Object_Get
  1778. func proxyjava_Object_Object_Get(refnum C.int32_t) C.int32_t {
  1779. ref := _seq.FromRefNum(int32(refnum))
  1780. v := ref.Get().(*java.Object).Object
  1781. var _v C.int32_t = _seq.NullRefNum
  1782. if v != nil {
  1783. _v = C.int32_t(_seq.ToRefNum(v))
  1784. }
  1785. return _v
  1786. }
  1787. //export new_java_Object
  1788. func new_java_Object() C.int32_t {
  1789. return C.int32_t(_seq.ToRefNum(new(java.Object)))
  1790. }
  1791. //export proxyjava_Runnable_Runnable_Set
  1792. func proxyjava_Runnable_Runnable_Set(refnum C.int32_t, v C.int32_t) {
  1793. ref := _seq.FromRefNum(int32(refnum))
  1794. var _v lang.Runnable
  1795. _v_ref := _seq.FromRefNum(int32(v))
  1796. if _v_ref != nil {
  1797. if v < 0 { // go object
  1798. _v = _v_ref.Get().(lang.Runnable)
  1799. } else { // foreign object
  1800. _v = (*proxy_class_java_lang_Runnable)(_v_ref)
  1801. }
  1802. }
  1803. ref.Get().(*java.Runnable).Runnable = _v
  1804. }
  1805. //export proxyjava_Runnable_Runnable_Get
  1806. func proxyjava_Runnable_Runnable_Get(refnum C.int32_t) C.int32_t {
  1807. ref := _seq.FromRefNum(int32(refnum))
  1808. v := ref.Get().(*java.Runnable).Runnable
  1809. var _v C.int32_t = _seq.NullRefNum
  1810. if v != nil {
  1811. _v = C.int32_t(_seq.ToRefNum(v))
  1812. }
  1813. return _v
  1814. }
  1815. //export proxyjava_Runnable_Run
  1816. func proxyjava_Runnable_Run(refnum C.int32_t, param_this C.int32_t) {
  1817. ref := _seq.FromRefNum(int32(refnum))
  1818. v := ref.Get().(*java.Runnable)
  1819. var _param_this java_1.Runnable
  1820. _param_this_ref := _seq.FromRefNum(int32(param_this))
  1821. if _param_this_ref != nil {
  1822. if param_this < 0 { // go object
  1823. _param_this = _param_this_ref.Get().(java_1.Runnable)
  1824. } else { // foreign object
  1825. _param_this = (*proxy_class_java_Runnable)(_param_this_ref)
  1826. }
  1827. }
  1828. v.Run(_param_this)
  1829. }
  1830. //export new_java_Runnable
  1831. func new_java_Runnable() C.int32_t {
  1832. return C.int32_t(_seq.ToRefNum(new(java.Runnable)))
  1833. }
  1834. //export proxyjava__NewInputStream
  1835. func proxyjava__NewInputStream() C.int32_t {
  1836. res_0 := java.NewInputStream()
  1837. var _res_0 C.int32_t = _seq.NullRefNum
  1838. if res_0 != nil {
  1839. _res_0 = C.int32_t(_seq.ToRefNum(res_0))
  1840. }
  1841. return _res_0
  1842. }