2023-03-07 07:51:31 +00:00
|
|
|
import java.util.Vector;
|
|
|
|
import java.lang.Boolean;
|
2023-03-07 15:34:34 +00:00
|
|
|
import java.lang.Object;
|
2023-03-07 07:51:31 +00:00
|
|
|
|
|
|
|
class Pair<U, T> {
|
|
|
|
U a;
|
|
|
|
T b;
|
|
|
|
|
|
|
|
make(x) {
|
2023-03-07 15:34:34 +00:00
|
|
|
var ret = new Pair<>();
|
|
|
|
ret.a = x.elementAt(0);
|
|
|
|
ret.b = x.elementAt(1);
|
|
|
|
return ret;
|
2023-03-07 07:51:31 +00:00
|
|
|
}
|
2023-03-08 15:54:00 +00:00
|
|
|
|
|
|
|
|
2023-03-07 15:34:34 +00:00
|
|
|
eq(a, b) {
|
|
|
|
b = a;
|
|
|
|
return a == b;
|
2023-03-07 07:51:31 +00:00
|
|
|
}
|
|
|
|
|
2023-03-08 15:51:48 +00:00
|
|
|
|
2023-03-07 15:34:34 +00:00
|
|
|
compare( p) {
|
|
|
|
return eq(p.a, p.b);
|
|
|
|
//return p.a == p.b;
|
|
|
|
}
|
2023-03-08 13:26:08 +00:00
|
|
|
|
2023-03-08 15:54:00 +00:00
|
|
|
|
2023-03-17 15:05:47 +00:00
|
|
|
/*
|
|
|
|
void m(Pair<?, ?> p, Vector<?> b)
|
2023-03-07 07:51:31 +00:00
|
|
|
{
|
|
|
|
//this.compare(p); //1, type incorrect
|
|
|
|
this.compare(this.make(b)); //2, OK
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|