private static void checkNull( TextWidth width, PluralCategory category ) { if (width == null) { throw new NullPointerException("Missing text width."); } checkNull(category); }
/** * <p>Yields a unit pattern which optionally contains a placeholder * of the form "{0}" standing for the count of units. </p> * * @param width text width (ABBREVIATED as synonym for SHORT) * @param category plural category * @param unit associated iso unit * @return unit pattern */ String getPattern( TextWidth width, PluralCategory category, IsoUnit unit ) { checkNull(width, category); return this.patterns.get(unit).get(width).get(category); }
/** * <p>Yields a unit pattern which optionally contains a placeholder * of the form "{0}" standing for the count of units in the * past. </p> * * @param category plural category * @param abbreviated using short form or not * @param unit associated iso unit * @return unit pattern in the past * @since 3.6/4.4 */ String getPatternInPast( PluralCategory category, boolean abbreviated, IsoUnit unit ) { checkNull(category); if (abbreviated) { return this.shortPast.get(unit).get(category); } else { return this.past.get(unit).get(category); } }
/** * <p>Yields a unit pattern which optionally contains a placeholder * of the form "{0}" standing for the count of units in the * future. </p> * * @param category plural category * @param abbreviated using short form or not * @param unit associated iso unit * @return unit pattern in the future * @since 3.6/4.4 */ String getPatternInFuture( PluralCategory category, boolean abbreviated, IsoUnit unit ) { checkNull(category); if (abbreviated) { return this.shortFuture.get(unit).get(category); } else { return this.future.get(unit).get(category); } }