Serialized Form
-
Package org.bardframework.time
-
Class org.bardframework.time.ChronologyJalali
class ChronologyJalali extends AbstractChronology implements Serializable- serialVersionUID:
- -1440403870442975015L
-
Class org.bardframework.time.LocalDateJalali
class LocalDateJalali extends Object implements Serializable- serialVersionUID:
- 2942565459149668126L
-
Serialized Fields
-
day
short day
The day-of-month. -
month
short month
The month-of-year. -
year
int year
The year.
-
-
Class org.bardframework.time.LocalDateTimeJalali
class LocalDateTimeJalali extends Object implements Serializable- serialVersionUID:
- 6207766400415563566L
-
Serialized Fields
-
date
LocalDateJalali date
The date part. -
time
LocalTime time
The time part.
-
-
Class org.bardframework.time.MonthDayJalali
class MonthDayJalali extends Object implements Serializable- serialVersionUID:
- -939150713474957432L
-
Serialized Fields
-
day
int day
The day-of-month. -
month
int month
The month-of-year, not null.
-
-
Class org.bardframework.time.OffsetDateTimeJalali
class OffsetDateTimeJalali extends Object implements Serializable- serialVersionUID:
- 2287754244819255394L
-
Serialized Fields
-
dateTime
LocalDateTimeJalali dateTime
The local date-time. -
offset
ZoneOffset offset
The offset from UTC/Greenwich.
-
-
Class org.bardframework.time.YearJalali
class YearJalali extends Object implements Serializable- serialVersionUID:
- -23038383694477807L
-
Serialized Fields
-
year
int year
The year being represented.
-
-
Class org.bardframework.time.YearMonthJalali
class YearMonthJalali extends Object implements Serializable- serialVersionUID:
- 4183400860270640070L
-
Serialized Fields
-
month
int month
The month-of-year, not null. -
year
int year
The year.
-
-
Class org.bardframework.time.ZonedDateTimeJalali
class ZonedDateTimeJalali extends Object implements Serializable- serialVersionUID:
- -6260982410461394882L
-
Serialized Fields
-
dateTime
LocalDateTimeJalali dateTime
The local date-time. -
offset
ZoneOffset offset
The offset from UTC/Greenwich. -
zone
ZoneId zone
The time-zone.
-
-
-
Package org.bardframework.time.zone
-
Class org.bardframework.time.zone.ZoneOffsetTransition
class ZoneOffsetTransition extends Object implements Serializable- serialVersionUID:
- -6946044323557704546L
-
Serialization Methods
-
readObject
Defend against malicious streams.- Parameters:
s- the stream to read- Throws:
InvalidObjectException- always
-
writeReplace
Writes the object using a dedicated serialized form.- Serial Data:
- Refer to the serialized form of
ZoneRules.writeReplace
for the encoding of epoch seconds and offsets.
out.writeByte(2); // identifies a ZoneOffsetTransition out.writeEpochSec(toEpochSecond); out.writeOffset(offsetBefore); out.writeOffset(offsetAfter);
-
-
Serialized Fields
-
epochSecond
long epochSecond
The transition epoch-second. -
offsetAfter
ZoneOffset offsetAfter
The offset after transition. -
offsetBefore
ZoneOffset offsetBefore
The offset before transition. -
transition
LocalDateTimeJalali transition
The local transition date-time at the transition.
-
-
Class org.bardframework.time.zone.ZoneOffsetTransitionRule
class ZoneOffsetTransitionRule extends Object implements Serializable- serialVersionUID:
- 6889046316657758795L
-
Serialization Methods
-
readObject
Defend against malicious streams.- Parameters:
s- the stream to read- Throws:
InvalidObjectException- always
-
writeReplace
Writes the object using a dedicated serialized form.- Serial Data:
- Refer to the serialized form of
ZoneRules.writeReplace
for the encoding of epoch seconds and offsets.
out.writeByte(3); // identifies a ZoneOffsetTransitionRule final int timeSecs = (timeEndOfDay ? 86400 : time.toSecondOfDay()); final int stdOffset = standardOffset.getTotalSeconds(); final int beforeDiff = offsetBefore.getTotalSeconds() - stdOffset; final int afterDiff = offsetAfter.getTotalSeconds() - stdOffset; final int timeByte = (timeSecs % 3600 == 0 ? (timeEndOfDay ? 24 : time.getHour()) : 31); final int stdOffsetByte = (stdOffset % 900 == 0 ? stdOffset / 900 + 128 : 255); final int beforeByte = (beforeDiff == 0 || beforeDiff == 1800 || beforeDiff == 3600 ? beforeDiff / 1800 : 3); final int afterByte = (afterDiff == 0 || afterDiff == 1800 || afterDiff == 3600 ? afterDiff / 1800 : 3); final int dowByte = (dow == null ? 0 : dow.getValue()); int b = (month.getValue() << 28) + // 4 bits ((dom + 32) << 22) + // 6 bits (dowByte << 19) + // 3 bits (timeByte << 14) + // 5 bits (timeDefinition.ordinal() << 12) + // 2 bits (stdOffsetByte << 4) + // 8 bits (beforeByte << 2) + // 2 bits afterByte; // 2 bits out.writeInt(b); if (timeByte == 31) { out.writeInt(timeSecs); } if (stdOffsetByte == 255) { out.writeInt(stdOffset); } if (beforeByte == 3) { out.writeInt(offsetBefore.getTotalSeconds()); } if (afterByte == 3) { out.writeInt(offsetAfter.getTotalSeconds()); }
-
-
Serialized Fields
-
dom
byte dom
The day-of-month of the month-day of the cutover week. If positive, it is the start of the week where the cutover can occur. If negative, it represents the end of the week where cutover can occur. The value is the number of days from the end of the month, such that-1is the last day of the month,-2is the second to last day, and so on. -
dow
DayOfWeek dow
The cutover day-of-week, null to retain the day-of-month. -
month
MonthJalali month
The month of the month-day of the first day of the cutover week. The actual date will be adjusted by the dowChange field. -
offsetAfter
ZoneOffset offsetAfter
The offset after the cutover. -
offsetBefore
ZoneOffset offsetBefore
The offset before the cutover. -
standardOffset
ZoneOffset standardOffset
The standard offset at the cutover. -
time
LocalTime time
The cutover time in the 'before' offset. -
timeDefinition
ZoneOffsetTransitionRule.TimeDefinition timeDefinition
The definition of how the local time should be interpreted. -
timeEndOfDay
boolean timeEndOfDay
Whether the cutover time is midnight at the end of day.
-
-
Class org.bardframework.time.zone.ZoneRules
class ZoneRules extends Object implements Serializable- serialVersionUID:
- 3044319355680032515L
-
Serialization Methods
-
readObject
Defend against malicious streams.- Parameters:
s- the stream to read- Throws:
InvalidObjectException- always
-
writeReplace
Writes the object using a dedicated serialized form.- Serial Data:
out.writeByte(1); // identifies a ZoneRules out.writeInt(standardTransitions.length); for (long trans : standardTransitions) { Ser.writeEpochSec(trans, out); } for (ZoneOffset offset : standardOffsets) { Ser.writeOffset(offset, out); } out.writeInt(savingsInstantTransitions.length); for (long trans : savingsInstantTransitions) { Ser.writeEpochSec(trans, out); } for (ZoneOffset offset : wallOffsets) { Ser.writeOffset(offset, out); } out.writeByte(lastRules.length); for (ZoneOffsetTransitionRule rule : lastRules) { rule.writeExternal(out); }Epoch second values used for offsets are encoded in a variable length form to make the common cases put fewer bytes in the stream.
static void writeEpochSec(long epochSec, DataOutput out) throws IOException { if (epochSec >= -4575744000L && epochSec < 10413792000L && epochSec % 900 == 0) { // quarter hours between 1825 and 2300 int store = (int) ((epochSec + 4575744000L) / 900); out.writeByte((store >>> 16) & 255); out.writeByte((store >>> 8) & 255); out.writeByte(store & 255); } else { out.writeByte(255); out.writeLong(epochSec); } }ZoneOffset values are encoded in a variable length form so the common cases put fewer bytes in the stream.
static void writeOffset(ZoneOffset offset, DataOutput out) throws IOException { final int offsetSecs = offset.getTotalSeconds(); int offsetByte = offsetSecs % 900 == 0 ? offsetSecs / 900 : 127; // compress to -72 to +72 out.writeByte(offsetByte); if (offsetByte == 127) { out.writeInt(offsetSecs); } }
-
-
Serialized Fields
-
lastRules
ZoneOffsetTransitionRule[] lastRules
The last rule. -
savingsInstantTransitions
long[] savingsInstantTransitions
The transitions between instants (epoch seconds), sorted. -
savingsLocalTransitions
LocalDateTimeJalali[] savingsLocalTransitions
The transitions between local date-times, sorted. This is a paired array, where the first entry is the start of the transition and the second entry is the end of the transition. -
standardOffsets
ZoneOffset[] standardOffsets
The standard offsets. -
standardTransitions
long[] standardTransitions
The transitions between standard offsets (epoch seconds), sorted. -
wallOffsets
ZoneOffset[] wallOffsets
The wall offsets.
-
-