equal
deleted
inserted
replaced
310 static boolean isValid(int code) { |
310 static boolean isValid(int code) { |
311 // allow numeric codes for standard ANSI characters |
311 // allow numeric codes for standard ANSI characters |
312 return codes.containsKey(code) || ( 32 <= code && code < 2127); |
312 return codes.containsKey(code) || ( 32 <= code && code < 2127); |
313 } |
313 } |
314 |
314 |
315 private static final Map<String,Entity> names = new HashMap<String,Entity>(); |
315 private static final Map<String,Entity> names = new HashMap<>(); |
316 private static final Map<Integer,Entity> codes = new HashMap<Integer,Entity>(); |
316 private static final Map<Integer,Entity> codes = new HashMap<>(); |
317 static { |
317 static { |
318 for (Entity e: values()) { |
318 for (Entity e: values()) { |
319 String name = e.name(); |
319 String name = e.name(); |
320 int code = e.code; |
320 int code = e.code; |
321 if (name.startsWith("_")) name = name.substring(1); |
321 if (name.startsWith("_")) name = name.substring(1); |