structs.java.golden 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. // Code generated by gobind. DO NOT EDIT.
  2. // Java class structs.S is a proxy for talking to a Go program.
  3. //
  4. // autogenerated by gobind -lang=java structs
  5. package structs;
  6. import go.Seq;
  7. public final class S implements Seq.Proxy {
  8. static { Structs.touch(); }
  9. private final int refnum;
  10. @Override public final int incRefnum() {
  11. Seq.incGoRef(refnum, this);
  12. return refnum;
  13. }
  14. S(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
  15. public S() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
  16. private static native int __New();
  17. public final native double getX();
  18. public final native void setX(double v);
  19. public final native double getY();
  20. public final native void setY(double v);
  21. public native S identity() throws Exception;
  22. public native double sum();
  23. @Override public boolean equals(Object o) {
  24. if (o == null || !(o instanceof S)) {
  25. return false;
  26. }
  27. S that = (S)o;
  28. double thisX = getX();
  29. double thatX = that.getX();
  30. if (thisX != thatX) {
  31. return false;
  32. }
  33. double thisY = getY();
  34. double thatY = that.getY();
  35. if (thisY != thatY) {
  36. return false;
  37. }
  38. return true;
  39. }
  40. @Override public int hashCode() {
  41. return java.util.Arrays.hashCode(new Object[] {getX(), getY()});
  42. }
  43. @Override public String toString() {
  44. StringBuilder b = new StringBuilder();
  45. b.append("S").append("{");
  46. b.append("X:").append(getX()).append(",");
  47. b.append("Y:").append(getY()).append(",");
  48. return b.append("}").toString();
  49. }
  50. }
  51. // Code generated by gobind. DO NOT EDIT.
  52. // Java class structs.S2 is a proxy for talking to a Go program.
  53. //
  54. // autogenerated by gobind -lang=java structs
  55. package structs;
  56. import go.Seq;
  57. public final class S2 implements Seq.Proxy, I {
  58. static { Structs.touch(); }
  59. private final int refnum;
  60. @Override public final int incRefnum() {
  61. Seq.incGoRef(refnum, this);
  62. return refnum;
  63. }
  64. S2(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
  65. public S2() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
  66. private static native int __New();
  67. public native void m();
  68. public native String string();
  69. @Override public boolean equals(Object o) {
  70. if (o == null || !(o instanceof S2)) {
  71. return false;
  72. }
  73. S2 that = (S2)o;
  74. return true;
  75. }
  76. @Override public int hashCode() {
  77. return java.util.Arrays.hashCode(new Object[] {});
  78. }
  79. @Override public String toString() {
  80. return string();
  81. }
  82. }
  83. // Code generated by gobind. DO NOT EDIT.
  84. // Java class structs.Structs_ is a proxy for talking to a Go program.
  85. //
  86. // autogenerated by gobind -lang=java structs
  87. package structs;
  88. import go.Seq;
  89. public final class Structs_ implements Seq.Proxy, I {
  90. static { Structs.touch(); }
  91. private final int refnum;
  92. @Override public final int incRefnum() {
  93. Seq.incGoRef(refnum, this);
  94. return refnum;
  95. }
  96. Structs_(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
  97. public Structs_() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
  98. private static native int __New();
  99. public native void m();
  100. @Override public boolean equals(Object o) {
  101. if (o == null || !(o instanceof Structs_)) {
  102. return false;
  103. }
  104. Structs_ that = (Structs_)o;
  105. return true;
  106. }
  107. @Override public int hashCode() {
  108. return java.util.Arrays.hashCode(new Object[] {});
  109. }
  110. @Override public String toString() {
  111. StringBuilder b = new StringBuilder();
  112. b.append("Structs_").append("{");
  113. return b.append("}").toString();
  114. }
  115. }
  116. // Code generated by gobind. DO NOT EDIT.
  117. // Java class structs.I is a proxy for talking to a Go program.
  118. //
  119. // autogenerated by gobind -lang=java structs
  120. package structs;
  121. import go.Seq;
  122. public interface I {
  123. public void m();
  124. }
  125. // Code generated by gobind. DO NOT EDIT.
  126. // Java class structs.Structs is a proxy for talking to a Go program.
  127. //
  128. // autogenerated by gobind -lang=java structs
  129. package structs;
  130. import go.Seq;
  131. public abstract class Structs {
  132. static {
  133. Seq.touch(); // for loading the native library
  134. _init();
  135. }
  136. private Structs() {} // uninstantiable
  137. // touch is called from other bound packages to initialize this package
  138. public static void touch() {}
  139. private static native void _init();
  140. private static final class proxyI implements Seq.Proxy, I {
  141. private final int refnum;
  142. @Override public final int incRefnum() {
  143. Seq.incGoRef(refnum, this);
  144. return refnum;
  145. }
  146. proxyI(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
  147. public native void m();
  148. }
  149. public static native S identity(S s);
  150. public static native S identityWithError(S s) throws Exception;
  151. }