import java.util.concurrent.*;
import java.io.*;
-public class AltosMag implements Cloneable, AltosHashable {
+public class AltosMag implements Cloneable, AltosJsonable {
public int along;
public int across;
public int through;
}
}
- public AltosHashSet hashSet() {
- AltosHashSet h = new AltosHashSet();
+ public AltosJson json() {
+ AltosJson j = new AltosJson();
- h.putInt("along", along);
- h.putInt("across", across);
- h.putInt("through", through);
- return h;
+ j.put("along", along);
+ j.put("across", across);
+ j.put("through", through);
+ return j;
}
- public AltosMag(AltosHashSet h) {
+ public AltosMag(AltosJson j) {
this();
- along = h.getInt("along", along);
- across = h.getInt("across", across);
- through = h.getInt("through", through);
+ along = j.get_int("along", along);
+ across = j.get_int("across", across);
+ through = j.get_int("through", through);
}
- public static AltosMag fromHashSet(AltosHashSet h, AltosMag def) {
- if (h == null)
+ public static AltosMag fromJson(AltosJson j, AltosMag def) {
+ if (j == null)
return def;
- return new AltosMag(h);
+ return new AltosMag(j);
}
}