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

Method of

base/src/main/java/net/time4j/UnitPatterns.java:232–250  ·  view source on GitHub ↗

Factory method as constructor replacement. @param lang language setting @return chached instance

(Locale lang)

Source from the content-addressed store, hash-verified

230 * @return chached instance
231 */
232 static UnitPatterns of(Locale lang) {
233
234 if (lang == null) {
235 throw new NullPointerException("Missing language.");
236 }
237
238 UnitPatterns p = CACHE.get(lang);
239
240 if (p == null) {
241 p = new UnitPatterns(lang);
242 UnitPatterns old = CACHE.putIfAbsent(lang, p);
243 if (old != null) {
244 p = old;
245 }
246 }
247
248 return p;
249
250 }
251
252 /**
253 * <p>Yields a unit pattern which optionally contains a placeholder

Callers 11

printYesterdayMethod · 0.95
printTodayMethod · 0.95
printTomorrowMethod · 0.95
printLastMethod · 0.95
printNextMethod · 0.95
printMethod · 0.95
printRelativeSecondsMethod · 0.95
getPastPatternMethod · 0.95
getFuturePatternMethod · 0.95

Calls 1

getMethod · 0.65

Tested by

no test coverage detected