X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2Faltoslib%2Fsrc%2Forg%2Faltusmetrum%2FAltosLib%2FAltosParse.java;h=7d832f1ab2e6ce15bdfa8d079b10c1c348490fb9;hb=3c2f601139d36761de6a8a2210545d082ef16133;hp=fbfcaaee7493c86275c0184c1ecfcdf900edd6a2;hpb=6510e8495fc5e8057b6092963def4d78978625a0;p=fw%2Faltos diff --git a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosParse.java b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosParse.java index fbfcaaee..7d832f1a 100644 --- a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosParse.java +++ b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosParse.java @@ -15,33 +15,33 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package org.altusmetrum.AltosLib; import java.text.*; import java.lang.*; public class AltosParse { - static boolean isdigit(char c) { + public static boolean isdigit(char c) { return '0' <= c && c <= '9'; } - static int parse_int(String v) throws ParseException { + public static int parse_int(String v) throws ParseException { try { - return Altos.fromdec(v); + return AltosLib.fromdec(v); } catch (NumberFormatException e) { throw new ParseException("error parsing int " + v, 0); } } - static int parse_hex(String v) throws ParseException { + public static int parse_hex(String v) throws ParseException { try { - return Altos.fromhex(v); + return AltosLib.fromhex(v); } catch (NumberFormatException e) { throw new ParseException("error parsing hex " + v, 0); } } - static double parse_double(String v) throws ParseException { + public static double parse_double(String v) throws ParseException { try { return Double.parseDouble(v); } catch (NumberFormatException e) { @@ -49,7 +49,7 @@ public class AltosParse { } } - static double parse_coord(String coord) throws ParseException { + public static double parse_coord(String coord) throws ParseException { String[] dsf = coord.split("\\D+"); if (dsf.length != 3) { @@ -65,13 +65,13 @@ public class AltosParse { return r; } - static String strip_suffix(String v, String suffix) { + public static String strip_suffix(String v, String suffix) { if (v.endsWith(suffix)) return v.substring(0, v.length() - suffix.length()); return v; } - static void word(String v, String m) throws ParseException { + public static void word(String v, String m) throws ParseException { if (!v.equals(m)) { throw new ParseException("error matching '" + v + "' '" + m + "'", 0); }