| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407 |
- // 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()
- }
|