< prev index next >

src/com/sun/jct/utils/glossarygen/Main.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg


 256             mapOut.println("<map version=\"1.0\">");
 257         }
 258 
 259         PrintWriter htmlOut = (htmlOutFile == null ? null
 260                                : new PrintWriter(new BufferedWriter(new FileWriter(htmlOutFile))));
 261         if (htmlOut != null) {
 262             htmlOut.println("<!DOCTYPE HTML>");
 263             htmlOut.println("<html>");
 264             htmlOut.println("<head>");
 265             htmlOut.println("<title>");
 266             htmlOut.println("Glossary");
 267             htmlOut.println("</title>");
 268             htmlOut.println("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"../jthelp.css\" TITLE=\"Style\">");
 269             htmlOut.println("</head>");
 270             htmlOut.println("<body>");
 271             htmlOut.println("<h1 class=\"glossary\">Glossary</h1>");
 272         }
 273 
 274         char currLetter = 0;
 275 
 276         for (Iterator iter = glossary.values().iterator(); iter.hasNext(); ) {
 277             Entry e = (Entry) (iter.next());
 278             if (!e.matches(keyword))
 279                 continue;
 280 
 281             String key = e.getKey();
 282             char initial = key.charAt(0);
 283             if (Character.isLetter(initial) && initial != currLetter) {
 284                 for (char c = (currLetter == 0 ? 'A' : (char) (currLetter + 1));
 285                      c <= initial; c++) {
 286                     if (glossaryOut != null) {
 287                         glossaryOut.println("");
 288                         glossaryOut.println("<!-- " + c + " -->");
 289                     }
 290                     if (htmlOut != null) {
 291                         htmlOut.println("");
 292                         htmlOut.println("<p class=\"glossaryHead2\">" + c + "</p>");
 293                     }
 294                 }
 295                 currLetter = initial;
 296             }
 297 


 990             if (Character.isLetterOrDigit(c) || c == '_') {
 991                 if (start == -1)
 992                     start = i;
 993             }
 994             else {
 995                 if (start != -1)
 996                     v.addElement(s.substring(start, i));
 997                 start = -1;
 998             }
 999         }
1000         if (start != -1)
1001             v.addElement(s.substring(start));
1002         String[] a = new String[v.size()];
1003         v.copyInto(a);
1004         return a;
1005     }
1006 
1007     private File file;
1008     private String head1;
1009     private String text;
1010     private Set keywords;
1011 
1012     private Reader in;
1013     private Writer out;
1014     private int c;
1015     private boolean inHead1;
1016     private int line;
1017     private int copyMode;
1018     private static final int NO_COPY = 0, PENDING_COPY = 1, SUPPRESS_COPY = 2, COPY = 3;
1019     private StringBuffer pendingCopy = new StringBuffer();
1020     private int hIndent;
1021     private int[] hNums = new int[6];
1022 }


 256             mapOut.println("<map version=\"1.0\">");
 257         }
 258 
 259         PrintWriter htmlOut = (htmlOutFile == null ? null
 260                                : new PrintWriter(new BufferedWriter(new FileWriter(htmlOutFile))));
 261         if (htmlOut != null) {
 262             htmlOut.println("<!DOCTYPE HTML>");
 263             htmlOut.println("<html>");
 264             htmlOut.println("<head>");
 265             htmlOut.println("<title>");
 266             htmlOut.println("Glossary");
 267             htmlOut.println("</title>");
 268             htmlOut.println("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"../jthelp.css\" TITLE=\"Style\">");
 269             htmlOut.println("</head>");
 270             htmlOut.println("<body>");
 271             htmlOut.println("<h1 class=\"glossary\">Glossary</h1>");
 272         }
 273 
 274         char currLetter = 0;
 275 
 276         for (Iterator<Entry> iter = glossary.values().iterator(); iter.hasNext(); ) {
 277             Entry e = (iter.next());
 278             if (!e.matches(keyword))
 279                 continue;
 280 
 281             String key = e.getKey();
 282             char initial = key.charAt(0);
 283             if (Character.isLetter(initial) && initial != currLetter) {
 284                 for (char c = (currLetter == 0 ? 'A' : (char) (currLetter + 1));
 285                      c <= initial; c++) {
 286                     if (glossaryOut != null) {
 287                         glossaryOut.println("");
 288                         glossaryOut.println("<!-- " + c + " -->");
 289                     }
 290                     if (htmlOut != null) {
 291                         htmlOut.println("");
 292                         htmlOut.println("<p class=\"glossaryHead2\">" + c + "</p>");
 293                     }
 294                 }
 295                 currLetter = initial;
 296             }
 297 


 990             if (Character.isLetterOrDigit(c) || c == '_') {
 991                 if (start == -1)
 992                     start = i;
 993             }
 994             else {
 995                 if (start != -1)
 996                     v.addElement(s.substring(start, i));
 997                 start = -1;
 998             }
 999         }
1000         if (start != -1)
1001             v.addElement(s.substring(start));
1002         String[] a = new String[v.size()];
1003         v.copyInto(a);
1004         return a;
1005     }
1006 
1007     private File file;
1008     private String head1;
1009     private String text;
1010     private Set<String> keywords;
1011 
1012     private Reader in;
1013     private Writer out;
1014     private int c;
1015     private boolean inHead1;
1016     private int line;
1017     private int copyMode;
1018     private static final int NO_COPY = 0, PENDING_COPY = 1, SUPPRESS_COPY = 2, COPY = 3;
1019     private StringBuffer pendingCopy = new StringBuffer();
1020     private int hIndent;
1021     private int[] hNums = new int[6];
1022 }
< prev index next >