/** *Zoneholdsinformationcorrespondingtoa"Zone"partofatime *zonedefinitionfile. * *@since1.4
*/ class Zone { // zone name (e.g., "America/Los_Angeles") private String name;
// zone records private List<ZoneRec> list;
// target zone names for this compilation privatestatic Set<String> targetZones;
/** *ConstructsaZonewiththespecifiedzonename. *@paramnamethezonename
*/
Zone(String name) { this.name = name;
list = new ArrayList<ZoneRec>();
}
/** *Readstimezonenamestobegenerated,called"targetzone *name",fromthespecifiedtextfileandcreatsaninternalhash *tabletokeepthosenames.It'sassumedthatonetextline *containsazonenameorcommentsifitstartswith *'#'.Commentscan'tfollowazonenameinasingleline. *@paramfileNamethetextfilename
*/ staticvoid readZoneNames(String fileName) { if (fileName == null) { return;
}
BufferedReader in = null; try {
FileReader fr = new FileReader(fileName);
in = new BufferedReader(fr);
} catch (FileNotFoundException e) {
Main.panic("can't open file: " + fileName);
}
targetZones = new HashSet<String>();
String line;
try { while ((line = in.readLine()) != null) {
line = line.trim(); if (line.length() == 0 || line.charAt(0) == '#') { continue;
} if (!targetZones.add(line)) {
Main.warning("duplicated target zone name: " + line);
}
}
in.close();
} catch (IOException e) {
Main.panic("IO error: "+e.getMessage());
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.