コード例 #1
0
 public static void main(String[] args)
     throws ParserConfigurationException, SAXException, IOException {
   EarthQuakeParser xp = new EarthQuakeParser();
   // String source = "data/2.5_week.atom";
   String source = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.atom";
   ArrayList<QuakeEntry> list = xp.read(source);
   Collections.sort(list);
   for (QuakeEntry loc : list) {
     System.out.println(loc);
   }
   System.out.println("# quakes = " + list.size());
 }
コード例 #2
0
 public static void main(String[] args)
     throws ParserConfigurationException, SAXException, IOException {
   EarthQuakeParser xp = new EarthQuakeParser();
   String source =
       "/Users/pimpek/repo/JavaPrinciples/EarthquakeFilterStarterProgram/data/nov20quakedata.atom";
   // String source = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.atom";
   ArrayList<QuakeEntry> list = xp.read(source);
   Collections.sort(list);
   for (QuakeEntry loc : list) {
     System.out.println(loc);
   }
   System.out.println("# quakes = " + list.size());
 }