-
Notifications
You must be signed in to change notification settings - Fork 782
/
Copy pathstructs.java.golden
211 lines (157 loc) · 5.47 KB
/
structs.java.golden
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
// Code generated by gobind. DO NOT EDIT.
// Java class structs.S is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java structs
package structs;
import go.Seq;
public final class S implements Seq.Proxy {
static { Structs.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
S(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public S() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
private static native int __New();
public final native double getX();
public final native void setX(double v);
public final native double getY();
public final native void setY(double v);
public native S identity() throws Exception;
public native S[] repeat(long n);
public native S[] repeatWithError(long n) throws Exception;
public native double sum();
@Override public boolean equals(Object o) {
if (o == null || !(o instanceof S)) {
return false;
}
S that = (S)o;
double thisX = getX();
double thatX = that.getX();
if (thisX != thatX) {
return false;
}
double thisY = getY();
double thatY = that.getY();
if (thisY != thatY) {
return false;
}
return true;
}
@Override public int hashCode() {
return java.util.Arrays.hashCode(new Object[] {getX(), getY()});
}
@Override public String toString() {
StringBuilder b = new StringBuilder();
b.append("S").append("{");
b.append("X:").append(getX()).append(",");
b.append("Y:").append(getY()).append(",");
return b.append("}").toString();
}
}
// Code generated by gobind. DO NOT EDIT.
// Java class structs.S2 is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java structs
package structs;
import go.Seq;
public final class S2 implements Seq.Proxy, I {
static { Structs.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
S2(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public S2() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
private static native int __New();
public native void m();
public native String string();
@Override public boolean equals(Object o) {
if (o == null || !(o instanceof S2)) {
return false;
}
S2 that = (S2)o;
return true;
}
@Override public int hashCode() {
return java.util.Arrays.hashCode(new Object[] {});
}
@Override public String toString() {
return string();
}
}
// Code generated by gobind. DO NOT EDIT.
// Java class structs.Structs_ is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java structs
package structs;
import go.Seq;
public final class Structs_ implements Seq.Proxy, I {
static { Structs.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
Structs_(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public Structs_() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
private static native int __New();
public native void m();
@Override public boolean equals(Object o) {
if (o == null || !(o instanceof Structs_)) {
return false;
}
Structs_ that = (Structs_)o;
return true;
}
@Override public int hashCode() {
return java.util.Arrays.hashCode(new Object[] {});
}
@Override public String toString() {
StringBuilder b = new StringBuilder();
b.append("Structs_").append("{");
return b.append("}").toString();
}
}
// Code generated by gobind. DO NOT EDIT.
// Java class structs.I is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java structs
package structs;
import go.Seq;
public interface I {
public void m();
}
// Code generated by gobind. DO NOT EDIT.
// Java class structs.Structs is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java structs
package structs;
import go.Seq;
public abstract class Structs {
static {
Seq.touch(); // for loading the native library
_init();
}
private Structs() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
private static final class proxyI implements Seq.Proxy, I {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyI(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native void m();
}
public static native double firstSum(S[] s);
public static native double firstSumWithError(S[] s) throws Exception;
public static native S identity(S s);
public static native S identityWithError(S s) throws Exception;
public static native S[] repeat(S s, long n);
public static native S[] repeatWithError(S s, long n) throws Exception;
}