* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_5;
+package org.altusmetrum.altoslib_11;
import java.util.concurrent.*;
import java.io.*;
-public class AltosMag implements Cloneable, Serializable {
+public class AltosMag implements Cloneable, AltosHashable {
public int along;
public int across;
public int through;
- public static double counts_per_gauss = 1090;
+ public static final double counts_per_gauss = 1090;
public static double convert_gauss(double counts) {
return counts / counts_per_gauss;
break;
}
}
+
+ public AltosHashSet hashSet() {
+ AltosHashSet h = new AltosHashSet();
+
+ h.putInt("along", along);
+ h.putInt("across", across);
+ h.putInt("through", through);
+ return h;
+ }
+
+ public AltosMag(AltosHashSet h) {
+ this();
+
+ along = h.getInt("along", along);
+ across = h.getInt("across", across);
+ through = h.getInt("through", through);
+ }
+
+ public static AltosMag fromHashSet(AltosHashSet h, AltosMag def) {
+ if (h == null)
+ return def;
+
+ return new AltosMag(h);
+ }
}