package gsod;

public class DataSet {

	public final static int YEAR_START = 15;
	public final static int YEAR_END = 18;

	public final static int TEMP_START = 25;
	public final static int TEMP_END = 30;

	public final static int MAX_START = 103;
	public final static int MAX_END = 108;

	public final static int MISSING = 9999;

	public static String getYear(String line) {
		return line.substring(YEAR_START, YEAR_END + 1);
	}

	public static int getTemp(String line) {
		return getInt(line, TEMP_START, TEMP_END);
	}

	public static int getMax(String line) {
		return getInt(line, MAX_START, MAX_END);
	}

	private static int getInt(String line, final int START, final int END) {
		// parseInt doesn't like leading plus signs
		if (line.charAt(87) == '+')
			return Integer.parseInt(line.substring(START + 1, END + 1));
		else
			return Integer.parseInt(line.substring(START, END + 1));
	}

}

@@ -72,16 +72,18 @@
 ART = 15
+-1
 ;%0A%09publi
@@ -114,16 +114,18 @@
 END = 18
+-1
 ;%0A%0A%09publ
@@ -686,108 +686,72 @@
 %7B%0A%09%09
-// parseInt doesn't like leading plus signs%0A%09%09if (line.charAt(87) == '+')%0A%09%09%09return Integer.parseInt
+line = line.replace('*', ' ');%0A%09%09return (int)(Double.parseDouble
 (lin
@@ -767,20 +767,16 @@
 ng(START
- + 1
 , END + 
@@ -782,73 +782,350 @@
  1))
-;%0A%09%09else%0A%09%09%09return Integer.parseInt(line.substring(START, END + 1
+ * 10);%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09String line = %22010010 99999  20081220    24.6 24    18.5 24   997.8 24   996.6 24    5.7  6   15.6 24   27.2  999.9    29.8*   20.7*  0.01G 999.9  001000%22;%0A%09%09System.out.println(DataSet.getYear(line));%0A%09%09System.out.println(DataSet.getTemp(line));%0A%09%09System.out.println(DataSet.getMax(line
 ));%0A

Fix DataSet class.