00001 package SummaryReader;
00002
00003 public class ScanInfo {
00004
00005 String type;
00006 String points;
00007 String[] values;
00008
00009 public ScanInfo() {
00010 }
00011
00012 public void setType(String type) {
00013 this.type=type;
00014 }
00015 public void setPoints(String nPoints) {
00016 this.points=nPoints;
00017 try {
00018 values = new String[Integer.parseInt(nPoints)];
00019 }catch(Exception e2){values = new String[1];};
00020 }
00021 public void setScanPoint(int index, String value) {
00022 if(values!=null && index<=values.length-1) values[index]=value;
00023 }
00024
00025 public String getSummaryTable() {
00026 if(type==null || type.startsWith("Null")) {
00027 return "<h3>Scan Information</h3>\nNone available.";
00028 }
00029 if(points==null) points="Unknown";
00030 StringBuffer table = new StringBuffer("<h3>Scan Information</h3>");
00031 table.append("<table border=1>\n");
00032 table.append("<tr><td>Type</td><td>#Points</td><td>Values</td></tr>\n");
00033 table.append("<tr><td>"+type+"</td><td>"+points+"</td><td>");
00034 for(int i=0;i<values.length;i++) {
00035 if(values[i]==null) continue;
00036 if(i>0) {
00037 if(i%16==0) table.append("<br>");
00038 else table.append(",");
00039 }
00040 table.append(values[i]);
00041 }
00042 table.append("</td></tr>");
00043 table.append("</table>\n");
00044 return table.toString();
00045 }
00046 }