(Locale language)
| 103 | //~ Konstruktoren ----------------------------------------------------- |
| 104 | |
| 105 | private UnitPatterns(Locale language) { |
| 106 | super(); |
| 107 | |
| 108 | this.locale = language; |
| 109 | |
| 110 | Map<IsoUnit, Map<TextWidth, Map<PluralCategory, String>>> map = new HashMap<>(10); |
| 111 | Map<IsoUnit, Map<PluralCategory, String>> mapPast = new HashMap<>(10); |
| 112 | Map<IsoUnit, Map<PluralCategory, String>> mapFuture = new HashMap<>(10); |
| 113 | Map<Integer, Map<TextWidth, String>> mapList = new HashMap<>(10); |
| 114 | Map<IsoUnit, Map<PluralCategory, String>> mapShortPast = new HashMap<>(10); |
| 115 | Map<IsoUnit, Map<PluralCategory, String>> mapShortFuture = new HashMap<>(10); |
| 116 | |
| 117 | for (IsoUnit unit : UNIT_IDS) { |
| 118 | // Standard-Muster |
| 119 | Map<TextWidth, Map<PluralCategory, String>> tmp1 = new EnumMap<>(TextWidth.class); |
| 120 | for (TextWidth width : TextWidth.values()) { |
| 121 | Map<PluralCategory, String> tmp2 = new EnumMap<>(PluralCategory.class); |
| 122 | for (PluralCategory cat : PluralCategory.values()) { |
| 123 | tmp2.put(cat, lookup(language, unit, width, cat)); |
| 124 | } |
| 125 | tmp1.put(width, Collections.unmodifiableMap(tmp2)); |
| 126 | } |
| 127 | map.put( |
| 128 | unit, |
| 129 | Collections.unmodifiableMap(tmp1)); |
| 130 | |
| 131 | if (!Character.isDigit(unit.getSymbol())) { // no subseconds |
| 132 | // Vergangenheit |
| 133 | Map<PluralCategory, String> tmp3 = new EnumMap<>(PluralCategory.class); |
| 134 | for (PluralCategory cat : PluralCategory.values()) { |
| 135 | tmp3.put(cat, lookup(language, unit, false, false, cat)); |
| 136 | } |
| 137 | mapPast.put( |
| 138 | unit, |
| 139 | Collections.unmodifiableMap(tmp3)); |
| 140 | Map<PluralCategory, String> tmp3a = new EnumMap<>(PluralCategory.class); |
| 141 | for (PluralCategory cat : PluralCategory.values()) { |
| 142 | tmp3a.put(cat, lookup(language, unit, false, true, cat)); |
| 143 | } |
| 144 | mapShortPast.put( |
| 145 | unit, |
| 146 | Collections.unmodifiableMap(tmp3a)); |
| 147 | |
| 148 | // Zukunft |
| 149 | Map<PluralCategory, String> tmp4 = new EnumMap<>(PluralCategory.class); |
| 150 | for (PluralCategory cat : PluralCategory.values()) { |
| 151 | tmp4.put(cat, lookup(language, unit, true, false, cat)); |
| 152 | } |
| 153 | mapFuture.put( |
| 154 | unit, |
| 155 | Collections.unmodifiableMap(tmp4)); |
| 156 | Map<PluralCategory, String> tmp4a = new EnumMap<>(PluralCategory.class); |
| 157 | for (PluralCategory cat : PluralCategory.values()) { |
| 158 | tmp4a.put(cat, lookup(language, unit, true, true, cat)); |
| 159 | } |
| 160 | mapShortFuture.put( |
| 161 | unit, |
| 162 | Collections.unmodifiableMap(tmp4a)); |
nothing calls this directly
no test coverage detected