MCPcopy Create free account
hub / github.com/MenoData/Time4J / writeDayPeriod

Method writeDayPeriod

base/src/main/java/net/time4j/SPX.java:551–578  ·  view source on GitHub ↗
(ObjectOutput out)

Source from the content-addressed store, hash-verified

549 }
550
551 private void writeDayPeriod(ObjectOutput out)
552 throws IOException {
553
554 DayPeriod.Element element = DayPeriod.Element.class.cast(this.obj);
555 Locale locale = element.getLocale();
556 int header = DAY_PERIOD_TYPE;
557 header <<= 4;
558 if (element.isFixed()) {
559 header |= 1;
560 }
561 if (locale == null) {
562 header |= 2;
563 }
564 out.writeByte(header);
565
566 if (locale == null) {
567 out.writeObject(element.getCodeMap());
568 } else {
569 String lang = locale.getLanguage();
570 String region = FormatUtils.getRegion(locale);
571 if (!region.isEmpty()) {
572 lang = lang + "-" + region;
573 }
574 out.writeUTF(lang);
575 out.writeUTF(element.getCalendarType());
576 }
577
578 }
579
580 @SuppressWarnings("unchecked")
581 private Object readDayPeriod(

Callers 1

writeExternalMethod · 0.95

Calls 7

getRegionMethod · 0.95
getCodeMapMethod · 0.80
isEmptyMethod · 0.65
castMethod · 0.45
getLocaleMethod · 0.45
isFixedMethod · 0.45
getCalendarTypeMethod · 0.45

Tested by

no test coverage detected