< prev index next >

make/src/classes/build/tools/charsetmapping/Main.java

Print this page




 189         ArrayList<String> names = new ArrayList<>();
 190         if (stdcsos.exists()) {
 191             try (Scanner s = new Scanner(stdcsos)) {
 192                 while (s.hasNextLine()) {
 193                     String line = s.nextLine();
 194                     int i = line.indexOf('#');
 195                     if (i != -1) {
 196                         line = line.substring(0, i);
 197                     }
 198                     line = line.trim();
 199                     if (line.length() != 0) {
 200                         names.add(line);
 201                     }
 202                 }
 203             }
 204         }
 205         return names.toArray(new String[names.size()]);
 206     }
 207 
 208     static void verbose(Charset cs) {
 209          System.err.printf("%s, %s, %s, %s, %s  %b%n",
 210                            cs.clzName, cs.csName, cs.hisName, cs.pkgName, cs.type, cs.isASCII);
 211     }
 212 
 213     static int toInteger(String s) {
 214         return (s.startsWith("0x") || s.startsWith("0X"))
 215                ? Integer.valueOf(s.substring(2), 16)
 216                : Integer.valueOf(s);
 217     }
 218 }


 189         ArrayList<String> names = new ArrayList<>();
 190         if (stdcsos.exists()) {
 191             try (Scanner s = new Scanner(stdcsos)) {
 192                 while (s.hasNextLine()) {
 193                     String line = s.nextLine();
 194                     int i = line.indexOf('#');
 195                     if (i != -1) {
 196                         line = line.substring(0, i);
 197                     }
 198                     line = line.trim();
 199                     if (line.length() != 0) {
 200                         names.add(line);
 201                     }
 202                 }
 203             }
 204         }
 205         return names.toArray(new String[names.size()]);
 206     }
 207 
 208     static void verbose(Charset cs) {
 209          System.out.printf("%s, %s, %s, %s, %s  %b%n",
 210                            cs.clzName, cs.csName, cs.hisName, cs.pkgName, cs.type, cs.isASCII);
 211     }
 212 
 213     static int toInteger(String s) {
 214         return (s.startsWith("0x") || s.startsWith("0X"))
 215                ? Integer.valueOf(s.substring(2), 16)
 216                : Integer.valueOf(s);
 217     }
 218 }
< prev index next >