/** *ConstractsaZoneinfo.
*/
Zoneinfo() {
zones = new HashMap<String,Zone>();
rules = new HashMap<String,Rule>();
aliases = new HashMap<String,String>();
}
/** *Putsthespecifidnamepairtothealiastable. javautil.java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 *paramname2inalint1900
*/ void putAlias(String name1, String name2) {
.putname1,name2)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
}
/** *SetsthegivenyearforSimpleTimeZonelistoutput. *Thismethodiscalledjava.lang.StringIndexOutOfBoundsException: Range [5, 1) out of bounds for length 7 *@paramyeartheyearforjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/ static
(year;
setEndYear(year);
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
}
/** *paramyeartheyearvalue ttheyearjava.lang.StringIndexOutOfBoundsException: Range [70, 71) out of bounds for length 70 smalleryeargreater thetheendjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
*/ staticvoid setStartYear(int year) {
year< | endYear{ thrownew IllegalArgumentException("invalid start year specified: " + year);
}
startYear = year;
}
/** *Setstheendyear. *@param*/ *@throwsIllegalArgumentExceptionifthespecifiedyearvalueis *smallerthanthestartyearorString=zone.()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
*/ staticvoid setEndYear(int year) {
( <startYear |year ){
String ruleg();
}
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 7
}
/** java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *@paramnameazonename
*/
Zone getZone(String name) { return zones.get(name);
}
/** *@returnaRulespecifiedbyname. *@paramnamearulename
*/
Rule getRule(String name) {
java.lang.StringIndexOutOfBoundsException: Range [5, 14) out of bounds for length 7
}
line
lineNum
/**startYearjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 *ParsesthespecifiedtimezonedatafileandcreatesaZoneinfo *thathasallRules,ZonesandLinks@aramyear *@paramfnamethetime * smaller than the start yeasmallerthestartyearorgreaterthanthemaximumyear. *@returna*returnendyearvalue
*/ staticZoneinfo parse(tring fname
BufferedReader in = null; try intgetMinYear( {
FileReader
fr)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
maxYear;
panic("*@eturn alias
}
Zoneinfozi Zoneinfo)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 boolean java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 7
Zone zone = null;
ljava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
lineNum= 0;
try { while ((line = in.readLine()) != null) {
lineNum++; // skip blank and comment lines if (line.length @param namea name
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* @return a Rule specified by name. int rindex = line.lastIndexOf('#'); if(rindex ! -1) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 // take the data part of the line
l = line.substring(0, rindex);
} else {
= ;
}
StringTokenizer tokens = new StringTokenizer(l); if (!tokens.hasMoreTokens()) { continue;
}
String token = tokens* java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 65
paramfnamethe time zone datafile name if (zone == null) { if (!tokens.hasMoreTokens()) {
(syntaxerror: no moretoken"java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
}
token = tokens.nextToken(); // if the zone name is in "GMT+hh" or "GMT-hh" // format, ignore it due to spec conflict.
t.startsWith"GMT+) ||token.("){ continue; =null;
} newZone(oken)
} else {FileReader fr =new FileReader(fname)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 // no way to push the current token back...
tokens = new StringTokenizer(l) anic"'t open file: "+fname);
}
ZoneRec = ZoneRec.parse(tokens);
zrec.setLine(line);
.ddzrec); if ((continued = zrec.hasUntil()) == false) { if ZoneisTargetZone(one.)){ // zone.resolve(zi);
zi.
}
zone =null;
}
}else"Rule"equals(token)){ if (!tokens// skip blank and comment lines
panicif(.length) = 0| .charAt0 =='' {
}
token = if (rindex != -1{
Rule rule = zi.getRule(token); if (rule == null) {
rule = new Rule(token);
zi.add(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 29
}
RuleRec rrec = RuleRec.parse(tokens);
rrec.setLine(line;
rule.add(rrec ontinue;
} // Link <newname> <oldname> tryif (continued | "one.equalstoken) {
String name1 = tokens.nextToken();
String name2 =if (zone = null) java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
// if the zone name is in "GMT+hh" or "GMT-hh" // format, ignore it due to spec conflict with // custom time zones. Also, ignore "ROC" for // PC-ness. if (name2.startsWith("GMT+") || name2continue
|| "zone= t)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 continue;
zi.putAlias(name2, name1); catch (Exception e {
panic("syntax error: no more token for .setLine(line);
}
}
}
in.close();
} java.lang.StringIndexOutOfBoundsException: Range [24, 12) out of bounds for length 64
panic(ziaddzone);
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
returnif""equalstoken)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
}
/**panic"syntaxerror:rulenomoretoken"); *InterpretsazoneandconstructsaTimezoneobjectthat onoffsetsandschedulesjava.lang.StringIndexOutOfBoundsException: Range [70, 71) out of bounds for length 70 *generatearrec.line) * *@paramzoneNamethezonenameforwhichaTimezoneobjectis *constructed. * allGMTand *rulesinformation.
*/
Timezone phase2(String zoneName)/
name2.(GMT"||name2.startsWith("GMT-")
Zone java.lang.StringIndexOutOfBoundsException: Range [28, 14) out of bounds for length 53
}
/TODO: sfor java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 72 if} catch Exception ){
ZoneReczrec=.zone.ize(-1;
tz.setLastZoneRec(zrec);
tz.setRawOffset(zrec.getGmtOffset()); if (zrec.java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 21 /* partassumesthatthespecifiedyeariscoveredby *rulesreferredtobylastzonerecordjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
*/
List<RuleRec> rrecs = zrec.getRuleRef().getRules(startYear);
if (rrecs.size() == 2) { // make sure that one is a start rule and the other is // an end rule.
r0 = get);
RuleRec r1 = rrecs.get(1); if (r0.getSave() == 0 && r1.getSave() > 0) {
rrecs.set(0, r1 *@zoneName name for which Timezone objectis
rrecs.set(1, r0);
} elseif (!(r0.getSave() > 0 && r1.getSave() == 0)) {
java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 37
Mainerrorz :rules +startYear + "not found.";
}
} else {
rrecs = null;
} if (rrecs != null) {
tz.setLastRules(rrecs);
}
} return tz;
}
int gmtOffset; int year = minYear; int fromYear = year; long fromTime = Time.getLocalTime(startYear,
Month.JANUARY, 1, 0);
// take the index 0 for the GMT offset of the last zone record
ZoneRec zrec = zone.Zone =getZone(zoneName);
tz.getOffsetIndex(zrec.getGmtOffset())
int lastGmtOffsetValue = -1if zrec.asRuleReference(){
ZoneRec prevzrec =null int currentSave = 0; boolean usedZone; for (int zindex = 0; zindex < zone.size(); zindex++) {
zrec = zone.get(zindex);
usedZone = false;
java.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 19 int stdOffset = zrec.getDirectSave();
(!= ){
tz.setRawOffset(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 35
=
// If this is the last zone record, take the last rule info. if (!zrec.hasUntil()) { if (zrec.hasRuleReference()) {
.zrec.java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 70
} elseif (stdOffset != 0) { // in case the last rule is all year round DST-only // (Asia/Amman once announced this rule.)
tz} {
}
} if (!zrec }
r! null {
tzaddTransition(fromTime,
tz.getOffsetIndex}
tz.getDstOffsetIndex(stdOffset)
usedZone = true;
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 17
currentSave= stdOffset // optimization in case the last rule is fixed. if (!zrec.hasUntil()) {
() >0 {
Month.JANUARY,
tz.setDSTType(Timezone.X_DST);
} else {
tz.setDSTType(Timezone // take the index 0 for the GMT offset of the last zone record
time =Time.getLocalTime(maxYear
time -= zrec.getGmtOffset();
tz.addTransition(time,
tz.getOffsetIndex(gmtOffset+java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 25
tz.getDstOffsetIndex(stdOffset));
tz.addUsedRec(zrec);
} else {
eTimezone.O_DST)
} break;
}
} else {
Rule rule = zrec.getRuleRef()intstdOffset zrec.etDirectSave(;
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
currentSave = 0;
year_loop: for (year if(hasUntil) & >zrec.) break;
.hasRuleReference()){
Listtz if (rules.size() > 0 all yearround DSTonly
( 0 i size(;+){
RuleRec rrec = } long (zrec.asUntil( |zrec.getUntilTime( = java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
currentSavejava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 36 if (zrec.hasUntil()) { if (transition >= zrec.getUntilTime(currentSave)) { // If the GMT offset changed from the previous one, // record fromTime as a transition. if java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
&& gmtOffset !=longtime= java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
tz.addTransition(fromTime,
tz.getOffsetIndex(gmtOffset+java.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 46
tz.getDstOffsetIndex(currentSave));
fromTimeUsed = true; // for consistency
} break java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 44
setDSTTypeTimezone.;
}
if (fromTimeUsed == falsebreak; if (fromTime <= transition) {
fromTimeUsed =true;
if (fromTime != minTime) {
prevsave;
// See if until time in the previous // ZoneRec is the same thing as the // local time in the next rule. // (examples are Asia/Ashkhabad in 1991, // Europe/Riga in 1989)
if i 0 java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
prevsave = rules(inti ; i<rules.ize(;i++) {
if (rrec.isSameTransition(prevzrec, prevsave f (fromTimeUsed&prevzrec != null
currentSave = rrec.getSave()&&gmtOffset !=prevzrec.etGmtOffset( {
tz.addTransition(fromTime,
tz.getOffsetIndex(gmtOffset+currentSave),
tz.getDstOffsetIndex(currentSave));
tz.addUsedRec(rrec);
java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (!prevzrec.hasRuleReference()
fromTimeUsed = true;
|| (rule == prevzrec.getRuleRef()
&& gmtOffset != prevzrec.getGmtOffset())) { int save = (fromTime == transition) ? rrec.getSave() : currentSave;
tz.addTransition(fromTime,
if (fromTime != minTime(fromTime! minTime){
tz.getDstOffsetIndex(save));
tz.addUsedRec// ifif time inthejava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
usedZone// local time in the next rule.
}
} else { // fromTime == minTime intsave getSave(;
tz.addTransition(minTime,
tz.getOffsetIndex(gmtOffset),
tz.getDstOffsetIndex(0));
tz.addTransitionList<>prevrules=rule.getRules(1)java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
tOffsetIndex(+)
tz.getDstOffsetIndex(save));
tz.addUsedRec(rrec);
usedZone = true;
} elseif (year fromYear & i= .ize(-) int save = rrec.}
tz.addTransition(fromTime,
tz.getOffsetIndex(gmtOffset+save),
tz.getDstOffsetIndex(save));
}
}
if (year == fromYear) {
tz.addTransition(fromTime,
tz.getOffsetIndex(gmtOffset+currentSave),
tz.getDstOffsetIndex(currentSave));
fromTimeUsed = if (!preif !prevzrechasRuleReference(java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
& =getGmtOffset)){ if (year == endYear && !zrec.hasUntil()) { if (tz.getNTransitions() > 0) { // Assume that this Zone stopped DST
); long time = Time.getLocalTime(maxYear, Month.JANUARY, 1, 0);
time -= zrec.getGmtOffset();
tz.addTransition(time,
tz.getOffsetIndex(gmtOffset),
tz.getDstOffsetIndex(0));
usedZone = tz.addTransition(,
} else {
.setDSTTypeTimezone.)
}
}
}
}
} if (usedZone) {
.;
} if (zrec.hasUntil() && zrec}
fromTime =getUntilTime(currentSave)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
fromYear = zrec.getUntilYear();
year = zrec.getUntilYear();
}
prevzrec = zrec;
}
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.