Coverage details for net.sf.tourviewer.JTourViewer

LineHitsSource
1 package net.sf.tourviewer;
2  
3 import java.io.BufferedInputStream;
4 import java.io.FileInputStream;
5 import java.io.IOException;
6 import java.io.InputStream;
7 import java.util.Arrays;
8 import net.sf.tourviewer.ciclo.CicloReader;
9  
100public class JTourViewer
11 {
12  
13     private static final int HAC4_SIGNATURE = 0xB735;
14     private static final int CM414M_SIGNATURE = 0xB723;
15  
16     public TourSet read(String filename) throws IOException {
170        InputStream in = new BufferedInputStream(new FileInputStream(filename));
18         try {
190            CicloReader reader = new CicloReader();
200            if (reader.accept(in)) {
210                TourSet tourSet = reader.read(in);
22                 //reader.print(System.out);
230                print(tourSet);
240                return tourSet;
25             }
26             else {
270                throw new IOException("No handler for input file");
28             }
29         }
300        finally {
31             try {
320                in.close();
330            } catch (Exception e) {}
340        }
35     }
36     
37     private void print(TourSet tourSet)
38     {
390        System.out.println(tourSet);
400        Tour[] tours = tourSet.getTours();
410        Arrays.sort(tours);
420        for (Tour tour : tours) {
430            System.out.println(tour);
44         }
450        System.out.println();
46         
470        for (Tour tour : tours) {
480            System.out.println(tour);
490            for (TourRecord record : tour.getRecords()) {
500                System.out.println(record);
51             }
520            System.out.println();
53         }
54  
550    }
56  
57     public static void main( String[] args )
58     {
590        if (args.length != 1) {
600            System.err.println("usage: java JTourViewer [filename]");
610            System.exit(1);
62         }
63         
640        JTourViewer app = new JTourViewer();
65         try {
660            app.read(args[0]);
67         }
680        catch (Exception e) {
690            e.printStackTrace();
70         }
710    }
72  
73 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.