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

Method getValue

base/src/main/java/net/time4j/DayPeriod.java:854–878  ·  view source on GitHub ↗
(ChronoEntity<?> context)

Source from the content-addressed store, hash-verified

852 }
853
854 @Override
855 public String getValue(ChronoEntity<?> context) { // used in consistency-check after strict parsing
856 PlainTime time = context.get(PlainTime.COMPONENT);
857 if (this.fixed) {
858 return getFixedCode(time);
859 } else {
860 if (this.dayPeriod.isPredefined()) {
861 Map<String, String> textForms = loadTextForms(this.getLocale(), this.getCalendarType());
862 String code = null;
863 if (time.isMidnight()) {
864 code = "midnight";
865 } else if (time.isSimultaneous(PlainTime.of(12))) {
866 code = "noon";
867 }
868 if (code != null) {
869 String key = createKey(textForms, TextWidth.ABBREVIATED, OutputContext.FORMAT, code);
870 if (textForms.containsKey(key)) {
871 return code;
872 }
873 }
874 }
875 PlainTime key = this.dayPeriod.getStart(time);
876 return this.dayPeriod.codeMap.get(key);
877 }
878 }
879
880 @Override
881 public String getMinimum(ChronoEntity<?> context) {

Callers

nothing calls this directly

Calls 12

getLocaleMethod · 0.95
getCalendarTypeMethod · 0.95
isMidnightMethod · 0.95
isSimultaneousMethod · 0.95
ofMethod · 0.95
getFixedCodeMethod · 0.80
isPredefinedMethod · 0.80
loadTextFormsMethod · 0.80
containsKeyMethod · 0.80
getMethod · 0.65
getStartMethod · 0.65
createKeyMethod · 0.45

Tested by

no test coverage detected