classes.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright 2014 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package java
  5. import (
  6. gopkg "Java/java"
  7. "Java/java/io"
  8. "Java/java/lang"
  9. "Java/java/lang/System"
  10. "Java/java/util/Spliterators"
  11. "Java/java/util/concurrent"
  12. )
  13. type Runnable struct {
  14. lang.Runnable
  15. }
  16. func (r *Runnable) Run(this gopkg.Runnable) {
  17. }
  18. type InputStream struct {
  19. io.InputStream
  20. }
  21. func (_ *InputStream) Read() (int32, error) {
  22. return 0, nil
  23. }
  24. func NewInputStream() *InputStream {
  25. return new(InputStream)
  26. }
  27. type Future struct {
  28. concurrent.Future
  29. }
  30. func (_ *Future) Get() (lang.Object, error) {
  31. return nil, nil
  32. }
  33. // Use a trailing underscore to override multiple overloaded methods.
  34. func (_ *Future) Get_(_ int64, _ concurrent.TimeUnit) (lang.Object, error) {
  35. return nil, nil
  36. }
  37. type Object struct {
  38. lang.Object
  39. }
  40. func innerClassTypes() {
  41. // java.util.Spliterators.iterator use inner class types
  42. // for the return value as well as parameters.
  43. Spliterators.Iterator(nil)
  44. }
  45. func returnType() {
  46. // Implicit types (java.io.Console) should be wrapped.
  47. cons := System.Console()
  48. cons.Flush()
  49. }