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

Method print

base/src/main/java/net/time4j/calendar/EastAsianME.java:147–170  ·  view source on GitHub ↗
(
        ChronoDisplay context,
        Appendable buffer,
        AttributeQuery attributes
    )

Source from the content-addressed store, hash-verified

145 }
146
147 @Override
148 public void print(
149 ChronoDisplay context,
150 Appendable buffer,
151 AttributeQuery attributes
152 ) throws IOException, ChronoException {
153
154 Locale loc = attributes.get(Attributes.LANGUAGE, Locale.ROOT);
155 EastAsianMonth eam = context.get(this);
156
157 if (attributes.contains(DualFormatElement.COUNT_OF_PATTERN_SYMBOLS)) { // numeric case
158 NumberSystem numsys = attributes.get(Attributes.NUMBER_SYSTEM, NumberSystem.ARABIC);
159 buffer.append(eam.getDisplayName(loc, numsys, attributes));
160 } else {
161 TextWidth tw = attributes.get(Attributes.TEXT_WIDTH, TextWidth.WIDE);
162 OutputContext oc = attributes.get(Attributes.OUTPUT_CONTEXT, OutputContext.FORMAT);
163 TextAccessor ta =
164 eam.isLeap()
165 ? CalendarText.getInstance("chinese", loc).getLeapMonths(tw, oc)
166 : CalendarText.getInstance("chinese", loc).getStdMonths(tw, oc);
167 buffer.append(ta.print(Month.valueOf(eam.getNumber()))); // uses the iso-month only as index for text forms
168 }
169
170 }
171
172 @Override
173 public EastAsianMonth parse(

Callers

nothing calls this directly

Calls 10

getDisplayNameMethod · 0.95
isLeapMethod · 0.95
getInstanceMethod · 0.95
printMethod · 0.95
valueOfMethod · 0.95
getNumberMethod · 0.95
getStdMonthsMethod · 0.80
getMethod · 0.65
containsMethod · 0.65
getLeapMonthsMethod · 0.45

Tested by

no test coverage detected