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

Method createKey

base/src/main/java/net/time4j/DayPeriod.java:512–541  ·  view source on GitHub ↗
(
        Map<String, String> textForms,
        TextWidth tw,
        OutputContext oc,
        String code
    )

Source from the content-addressed store, hash-verified

510 }
511
512 private static String createKey(
513 Map<String, String> textForms,
514 TextWidth tw,
515 OutputContext oc,
516 String code
517 ) {
518
519 if (tw == TextWidth.SHORT) {
520 tw = TextWidth.ABBREVIATED;
521 }
522
523 String key = toPrefix(tw, oc) + code;
524
525 if (!textForms.containsKey(key)) {
526 if (oc == OutputContext.STANDALONE) {
527 if (tw == TextWidth.ABBREVIATED) {
528 key = createKey(textForms, tw, OutputContext.FORMAT, code);
529 } else {
530 key = createKey(textForms, TextWidth.ABBREVIATED, oc, code);
531 }
532 } else {
533 if (tw != TextWidth.ABBREVIATED) {
534 key = createKey(textForms, TextWidth.ABBREVIATED, oc, code);
535 }
536 }
537 }
538
539 return key;
540
541 }
542
543 private static String toPrefix(
544 TextWidth tw,

Callers 3

getValueMethod · 0.45
parseMethod · 0.45
applyMethod · 0.45

Calls 2

toPrefixMethod · 0.95
containsKeyMethod · 0.80

Tested by

no test coverage detected