author | mduigou |
Tue, 05 Nov 2013 19:44:41 -0800 | |
changeset 21615 | 0231a565a5b7 |
parent 20522 | 9a239bba214f |
child 22081 | 86eb26ff8f2b |
permissions | -rw-r--r-- |
15658 | 1 |
/* |
2 |
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
/* |
|
27 |
* This file is available under and governed by the GNU General Public |
|
28 |
* License version 2 only, as published by the Free Software Foundation. |
|
29 |
* However, the following notice accompanied the original version of this |
|
30 |
* file: |
|
31 |
* |
|
32 |
* Copyright (c) 2007-2012, Stephen Colebourne & Michael Nascimento Santos |
|
33 |
* |
|
34 |
* All rights reserved. |
|
35 |
* |
|
36 |
* Redistribution and use in source and binary forms, with or without |
|
37 |
* modification, are permitted provided that the following conditions are met: |
|
38 |
* |
|
39 |
* * Redistributions of source code must retain the above copyright notice, |
|
40 |
* this list of conditions and the following disclaimer. |
|
41 |
* |
|
42 |
* * Redistributions in binary form must reproduce the above copyright notice, |
|
43 |
* this list of conditions and the following disclaimer in the documentation |
|
44 |
* and/or other materials provided with the distribution. |
|
45 |
* |
|
46 |
* * Neither the name of JSR-310 nor the names of its contributors |
|
47 |
* may be used to endorse or promote products derived from this software |
|
48 |
* without specific prior written permission. |
|
49 |
* |
|
50 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
51 |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
52 |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
53 |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
|
54 |
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
|
55 |
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
|
56 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
|
57 |
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
|
58 |
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
|
59 |
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
60 |
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
61 |
*/ |
|
62 |
package java.time.chrono; |
|
63 |
||
64 |
import static java.time.temporal.ChronoUnit.SECONDS; |
|
65 |
||
66 |
import java.io.IOException; |
|
67 |
import java.io.InvalidObjectException; |
|
68 |
import java.io.ObjectInput; |
|
69 |
import java.io.ObjectOutput; |
|
70 |
import java.io.ObjectStreamException; |
|
71 |
import java.io.Serializable; |
|
72 |
import java.time.Instant; |
|
73 |
import java.time.LocalDateTime; |
|
74 |
import java.time.ZoneId; |
|
75 |
import java.time.ZoneOffset; |
|
76 |
import java.time.temporal.ChronoField; |
|
77 |
import java.time.temporal.ChronoUnit; |
|
78 |
import java.time.temporal.Temporal; |
|
79 |
import java.time.temporal.TemporalField; |
|
80 |
import java.time.temporal.TemporalUnit; |
|
81 |
import java.time.zone.ZoneOffsetTransition; |
|
82 |
import java.time.zone.ZoneRules; |
|
83 |
import java.util.List; |
|
84 |
import java.util.Objects; |
|
85 |
||
86 |
/** |
|
87 |
* A date-time with a time-zone in the calendar neutral API. |
|
88 |
* <p> |
|
89 |
* {@code ZoneChronoDateTime} is an immutable representation of a date-time with a time-zone. |
|
90 |
* This class stores all date and time fields, to a precision of nanoseconds, |
|
91 |
* as well as a time-zone and zone offset. |
|
92 |
* <p> |
|
93 |
* The purpose of storing the time-zone is to distinguish the ambiguous case where |
|
94 |
* the local time-line overlaps, typically as a result of the end of daylight time. |
|
95 |
* Information about the local-time can be obtained using methods on the time-zone. |
|
96 |
* |
|
17474 | 97 |
* @implSpec |
15658 | 98 |
* This class is immutable and thread-safe. |
99 |
* |
|
19841
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
100 |
* @serial Document the delegation of this class in the serialized-form specification. |
15658 | 101 |
* @param <D> the concrete type for the date of this date-time |
102 |
* @since 1.8 |
|
103 |
*/ |
|
19030 | 104 |
final class ChronoZonedDateTimeImpl<D extends ChronoLocalDate> |
15658 | 105 |
implements ChronoZonedDateTime<D>, Serializable { |
106 |
||
107 |
/** |
|
108 |
* Serialization version. |
|
109 |
*/ |
|
110 |
private static final long serialVersionUID = -5261813987200935591L; |
|
111 |
||
112 |
/** |
|
113 |
* The local date-time. |
|
114 |
*/ |
|
19841
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
115 |
private final transient ChronoLocalDateTimeImpl<D> dateTime; |
15658 | 116 |
/** |
117 |
* The zone offset. |
|
118 |
*/ |
|
19841
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
119 |
private final transient ZoneOffset offset; |
15658 | 120 |
/** |
121 |
* The zone ID. |
|
122 |
*/ |
|
19841
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
123 |
private final transient ZoneId zone; |
15658 | 124 |
|
125 |
//----------------------------------------------------------------------- |
|
126 |
/** |
|
127 |
* Obtains an instance from a local date-time using the preferred offset if possible. |
|
128 |
* |
|
129 |
* @param localDateTime the local date-time, not null |
|
130 |
* @param zone the zone identifier, not null |
|
131 |
* @param preferredOffset the zone offset, null if no preference |
|
132 |
* @return the zoned date-time, not null |
|
133 |
*/ |
|
19030 | 134 |
static <R extends ChronoLocalDate> ChronoZonedDateTime<R> ofBest( |
15658 | 135 |
ChronoLocalDateTimeImpl<R> localDateTime, ZoneId zone, ZoneOffset preferredOffset) { |
136 |
Objects.requireNonNull(localDateTime, "localDateTime"); |
|
137 |
Objects.requireNonNull(zone, "zone"); |
|
138 |
if (zone instanceof ZoneOffset) { |
|
139 |
return new ChronoZonedDateTimeImpl<>(localDateTime, (ZoneOffset) zone, zone); |
|
140 |
} |
|
141 |
ZoneRules rules = zone.getRules(); |
|
142 |
LocalDateTime isoLDT = LocalDateTime.from(localDateTime); |
|
143 |
List<ZoneOffset> validOffsets = rules.getValidOffsets(isoLDT); |
|
144 |
ZoneOffset offset; |
|
145 |
if (validOffsets.size() == 1) { |
|
146 |
offset = validOffsets.get(0); |
|
147 |
} else if (validOffsets.size() == 0) { |
|
148 |
ZoneOffsetTransition trans = rules.getTransition(isoLDT); |
|
149 |
localDateTime = localDateTime.plusSeconds(trans.getDuration().getSeconds()); |
|
150 |
offset = trans.getOffsetAfter(); |
|
151 |
} else { |
|
152 |
if (preferredOffset != null && validOffsets.contains(preferredOffset)) { |
|
153 |
offset = preferredOffset; |
|
154 |
} else { |
|
155 |
offset = validOffsets.get(0); |
|
156 |
} |
|
157 |
} |
|
158 |
Objects.requireNonNull(offset, "offset"); // protect against bad ZoneRules |
|
159 |
return new ChronoZonedDateTimeImpl<>(localDateTime, offset, zone); |
|
160 |
} |
|
161 |
||
162 |
/** |
|
163 |
* Obtains an instance from an instant using the specified time-zone. |
|
164 |
* |
|
165 |
* @param chrono the chronology, not null |
|
166 |
* @param instant the instant, not null |
|
167 |
* @param zone the zone identifier, not null |
|
168 |
* @return the zoned date-time, not null |
|
169 |
*/ |
|
170 |
static ChronoZonedDateTimeImpl<?> ofInstant(Chronology chrono, Instant instant, ZoneId zone) { |
|
171 |
ZoneRules rules = zone.getRules(); |
|
172 |
ZoneOffset offset = rules.getOffset(instant); |
|
173 |
Objects.requireNonNull(offset, "offset"); // protect against bad ZoneRules |
|
174 |
LocalDateTime ldt = LocalDateTime.ofEpochSecond(instant.getEpochSecond(), instant.getNano(), offset); |
|
19030 | 175 |
ChronoLocalDateTimeImpl<?> cldt = (ChronoLocalDateTimeImpl<?>)chrono.localDateTime(ldt); |
176 |
return new ChronoZonedDateTimeImpl<>(cldt, offset, zone); |
|
15658 | 177 |
} |
178 |
||
179 |
/** |
|
180 |
* Obtains an instance from an {@code Instant}. |
|
181 |
* |
|
182 |
* @param instant the instant to create the date-time from, not null |
|
183 |
* @param zone the time-zone to use, validated not null |
|
184 |
* @return the zoned date-time, validated not null |
|
185 |
*/ |
|
19030 | 186 |
@SuppressWarnings("unchecked") |
15658 | 187 |
private ChronoZonedDateTimeImpl<D> create(Instant instant, ZoneId zone) { |
20522 | 188 |
return (ChronoZonedDateTimeImpl<D>)ofInstant(getChronology(), instant, zone); |
15658 | 189 |
} |
190 |
||
19030 | 191 |
/** |
192 |
* Casts the {@code Temporal} to {@code ChronoZonedDateTimeImpl} ensuring it bas the specified chronology. |
|
193 |
* |
|
194 |
* @param chrono the chronology to check for, not null |
|
195 |
* @param temporal a date-time to cast, not null |
|
196 |
* @return the date-time checked and cast to {@code ChronoZonedDateTimeImpl}, not null |
|
197 |
* @throws ClassCastException if the date-time cannot be cast to ChronoZonedDateTimeImpl |
|
198 |
* or the chronology is not equal this Chronology |
|
199 |
*/ |
|
200 |
static <R extends ChronoLocalDate> ChronoZonedDateTimeImpl<R> ensureValid(Chronology chrono, Temporal temporal) { |
|
201 |
@SuppressWarnings("unchecked") |
|
202 |
ChronoZonedDateTimeImpl<R> other = (ChronoZonedDateTimeImpl<R>) temporal; |
|
20522 | 203 |
if (chrono.equals(other.getChronology()) == false) { |
19030 | 204 |
throw new ClassCastException("Chronology mismatch, required: " + chrono.getId() |
20522 | 205 |
+ ", actual: " + other.getChronology().getId()); |
19030 | 206 |
} |
207 |
return other; |
|
208 |
} |
|
209 |
||
15658 | 210 |
//----------------------------------------------------------------------- |
211 |
/** |
|
212 |
* Constructor. |
|
213 |
* |
|
214 |
* @param dateTime the date-time, not null |
|
215 |
* @param offset the zone offset, not null |
|
216 |
* @param zone the zone ID, not null |
|
217 |
*/ |
|
218 |
private ChronoZonedDateTimeImpl(ChronoLocalDateTimeImpl<D> dateTime, ZoneOffset offset, ZoneId zone) { |
|
219 |
this.dateTime = Objects.requireNonNull(dateTime, "dateTime"); |
|
220 |
this.offset = Objects.requireNonNull(offset, "offset"); |
|
221 |
this.zone = Objects.requireNonNull(zone, "zone"); |
|
222 |
} |
|
223 |
||
224 |
//----------------------------------------------------------------------- |
|
19841
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
225 |
@Override |
15658 | 226 |
public ZoneOffset getOffset() { |
227 |
return offset; |
|
228 |
} |
|
229 |
||
230 |
@Override |
|
231 |
public ChronoZonedDateTime<D> withEarlierOffsetAtOverlap() { |
|
232 |
ZoneOffsetTransition trans = getZone().getRules().getTransition(LocalDateTime.from(this)); |
|
233 |
if (trans != null && trans.isOverlap()) { |
|
234 |
ZoneOffset earlierOffset = trans.getOffsetBefore(); |
|
235 |
if (earlierOffset.equals(offset) == false) { |
|
20520
0952771e3e25
8024835: Change until() to accept any compatible temporal
rriggs
parents:
19841
diff
changeset
|
236 |
return new ChronoZonedDateTimeImpl<>(dateTime, earlierOffset, zone); |
15658 | 237 |
} |
238 |
} |
|
239 |
return this; |
|
240 |
} |
|
241 |
||
242 |
@Override |
|
243 |
public ChronoZonedDateTime<D> withLaterOffsetAtOverlap() { |
|
244 |
ZoneOffsetTransition trans = getZone().getRules().getTransition(LocalDateTime.from(this)); |
|
245 |
if (trans != null) { |
|
246 |
ZoneOffset offset = trans.getOffsetAfter(); |
|
247 |
if (offset.equals(getOffset()) == false) { |
|
20520
0952771e3e25
8024835: Change until() to accept any compatible temporal
rriggs
parents:
19841
diff
changeset
|
248 |
return new ChronoZonedDateTimeImpl<>(dateTime, offset, zone); |
15658 | 249 |
} |
250 |
} |
|
251 |
return this; |
|
252 |
} |
|
253 |
||
254 |
//----------------------------------------------------------------------- |
|
255 |
@Override |
|
256 |
public ChronoLocalDateTime<D> toLocalDateTime() { |
|
257 |
return dateTime; |
|
258 |
} |
|
259 |
||
19841
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
260 |
@Override |
15658 | 261 |
public ZoneId getZone() { |
262 |
return zone; |
|
263 |
} |
|
264 |
||
19841
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
265 |
@Override |
15658 | 266 |
public ChronoZonedDateTime<D> withZoneSameLocal(ZoneId zone) { |
267 |
return ofBest(dateTime, zone, offset); |
|
268 |
} |
|
269 |
||
270 |
@Override |
|
271 |
public ChronoZonedDateTime<D> withZoneSameInstant(ZoneId zone) { |
|
272 |
Objects.requireNonNull(zone, "zone"); |
|
273 |
return this.zone.equals(zone) ? this : create(dateTime.toInstant(offset), zone); |
|
274 |
} |
|
275 |
||
276 |
//----------------------------------------------------------------------- |
|
277 |
@Override |
|
278 |
public boolean isSupported(TemporalField field) { |
|
279 |
return field instanceof ChronoField || (field != null && field.isSupportedBy(this)); |
|
280 |
} |
|
281 |
||
282 |
//----------------------------------------------------------------------- |
|
283 |
@Override |
|
284 |
public ChronoZonedDateTime<D> with(TemporalField field, long newValue) { |
|
285 |
if (field instanceof ChronoField) { |
|
286 |
ChronoField f = (ChronoField) field; |
|
287 |
switch (f) { |
|
288 |
case INSTANT_SECONDS: return plus(newValue - toEpochSecond(), SECONDS); |
|
289 |
case OFFSET_SECONDS: { |
|
290 |
ZoneOffset offset = ZoneOffset.ofTotalSeconds(f.checkValidIntValue(newValue)); |
|
291 |
return create(dateTime.toInstant(offset), zone); |
|
292 |
} |
|
293 |
} |
|
294 |
return ofBest(dateTime.with(field, newValue), zone, offset); |
|
295 |
} |
|
20522 | 296 |
return ChronoZonedDateTimeImpl.ensureValid(getChronology(), field.adjustInto(this, newValue)); |
15658 | 297 |
} |
298 |
||
299 |
//----------------------------------------------------------------------- |
|
300 |
@Override |
|
301 |
public ChronoZonedDateTime<D> plus(long amountToAdd, TemporalUnit unit) { |
|
302 |
if (unit instanceof ChronoUnit) { |
|
303 |
return with(dateTime.plus(amountToAdd, unit)); |
|
304 |
} |
|
20522 | 305 |
return ChronoZonedDateTimeImpl.ensureValid(getChronology(), unit.addTo(this, amountToAdd)); /// TODO: Generics replacement Risk! |
15658 | 306 |
} |
307 |
||
308 |
//----------------------------------------------------------------------- |
|
309 |
@Override |
|
20520
0952771e3e25
8024835: Change until() to accept any compatible temporal
rriggs
parents:
19841
diff
changeset
|
310 |
public long until(Temporal endExclusive, TemporalUnit unit) { |
0952771e3e25
8024835: Change until() to accept any compatible temporal
rriggs
parents:
19841
diff
changeset
|
311 |
Objects.requireNonNull(endExclusive, "endExclusive"); |
15658 | 312 |
@SuppressWarnings("unchecked") |
20522 | 313 |
ChronoZonedDateTime<D> end = (ChronoZonedDateTime<D>) getChronology().zonedDateTime(endExclusive); |
15658 | 314 |
if (unit instanceof ChronoUnit) { |
315 |
end = end.withZoneSameInstant(offset); |
|
19030 | 316 |
return dateTime.until(end.toLocalDateTime(), unit); |
15658 | 317 |
} |
20520
0952771e3e25
8024835: Change until() to accept any compatible temporal
rriggs
parents:
19841
diff
changeset
|
318 |
Objects.requireNonNull(unit, "unit"); |
0952771e3e25
8024835: Change until() to accept any compatible temporal
rriggs
parents:
19841
diff
changeset
|
319 |
return unit.between(this, end); |
15658 | 320 |
} |
321 |
||
322 |
//----------------------------------------------------------------------- |
|
19841
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
323 |
/** |
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
324 |
* Writes the ChronoZonedDateTime using a |
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
325 |
* <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>. |
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
326 |
* @serialData |
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
327 |
* <pre> |
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
328 |
* out.writeByte(3); // identifies a ChronoZonedDateTime |
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
329 |
* out.writeObject(toLocalDateTime()); |
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
330 |
* out.writeObject(getOffset()); |
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
331 |
* out.writeObject(getZone()); |
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
332 |
* </pre> |
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
333 |
* |
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
334 |
* @return the instance of {@code Ser}, not null |
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
335 |
*/ |
15658 | 336 |
private Object writeReplace() { |
337 |
return new Ser(Ser.CHRONO_ZONE_DATE_TIME_TYPE, this); |
|
338 |
} |
|
339 |
||
340 |
/** |
|
341 |
* Defend against malicious streams. |
|
342 |
* @return never |
|
343 |
* @throws InvalidObjectException always |
|
344 |
*/ |
|
19841
15c8e97d6a14
8024164: JSR310 serialization should be described in details
rriggs
parents:
19030
diff
changeset
|
345 |
private Object readResolve() throws InvalidObjectException { |
15658 | 346 |
throw new InvalidObjectException("Deserialization via serialization delegate"); |
347 |
} |
|
348 |
||
349 |
void writeExternal(ObjectOutput out) throws IOException { |
|
350 |
out.writeObject(dateTime); |
|
351 |
out.writeObject(offset); |
|
352 |
out.writeObject(zone); |
|
353 |
} |
|
354 |
||
355 |
static ChronoZonedDateTime<?> readExternal(ObjectInput in) throws IOException, ClassNotFoundException { |
|
356 |
ChronoLocalDateTime<?> dateTime = (ChronoLocalDateTime<?>) in.readObject(); |
|
357 |
ZoneOffset offset = (ZoneOffset) in.readObject(); |
|
358 |
ZoneId zone = (ZoneId) in.readObject(); |
|
359 |
return dateTime.atZone(offset).withZoneSameLocal(zone); |
|
360 |
// TODO: ZDT uses ofLenient() |
|
361 |
} |
|
362 |
||
363 |
//------------------------------------------------------------------------- |
|
364 |
@Override |
|
365 |
public boolean equals(Object obj) { |
|
366 |
if (this == obj) { |
|
367 |
return true; |
|
368 |
} |
|
369 |
if (obj instanceof ChronoZonedDateTime) { |
|
370 |
return compareTo((ChronoZonedDateTime<?>) obj) == 0; |
|
371 |
} |
|
372 |
return false; |
|
373 |
} |
|
374 |
||
375 |
@Override |
|
376 |
public int hashCode() { |
|
377 |
return toLocalDateTime().hashCode() ^ getOffset().hashCode() ^ Integer.rotateLeft(getZone().hashCode(), 3); |
|
378 |
} |
|
379 |
||
380 |
@Override |
|
381 |
public String toString() { |
|
382 |
String str = toLocalDateTime().toString() + getOffset().toString(); |
|
383 |
if (getOffset() != getZone()) { |
|
384 |
str += '[' + getZone().toString() + ']'; |
|
385 |
} |
|
386 |
return str; |
|
387 |
} |
|
388 |
||
389 |
||
390 |
} |