net.time4j.format.PluralProvider Maven / Gradle / Ivy
/*
* -----------------------------------------------------------------------
* Copyright © 2013-2015 Meno Hochschild,
* -----------------------------------------------------------------------
* This file (PluralProvider.java) is part of project Time4J.
*
* Time4J is free software: You can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 2.1 of the License, or
* (at your option) any later version.
*
* Time4J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Time4J. If not, see .
* -----------------------------------------------------------------------
*/
package net.time4j.format;
import java.util.Locale;
/**
* This SPI-interface enables the access to localized
* plural rules and is instantiated via a {@code ServiceLoader}-mechanism.
*
* If there is no external {@code PluralProvider} then Time4J will use
* an internal implementation which only supports English and else yield
* very simplified standard plural rules which might be incorrect. If
* applications need true i18n-support then the i18n-module should be used
* which has a general implementation of this interface.
*
* @author Meno Hochschild
* @since 2.2
* @see java.util.ServiceLoader
* @doctags.spec Implementations must have a public no-arg constructor.
*/
/*[deutsch]
* Dieses SPI-Interface ermöglicht den Zugriff
* auf {@code Locale}-abhängige Pluralregeln und wird über einen
* {@code ServiceLoader}-Mechanismus instanziert.
*
* Wird kein externer {@code PluralProvider} gefunden, wird intern
* eine Instanz erzeugt, die entweder Englisch unterstützt oder sonst
* stark vereinfachte Pluralregeln liefert, die nicht notwendig korrekt
* sein müssen. Wenn Anwendungen echte I18n-Unterstützung
* brauchen, sollten sie das i18n-Modul von Time4J einbinden, das einen
* allgemeinen {@code PluralProvider} hat.
*
* @author Meno Hochschild
* @since 2.2
* @see java.util.ServiceLoader
* @doctags.spec Implementations must have a public no-arg constructor.
*/
public interface PluralProvider {
//~ Methoden ----------------------------------------------------------
/**
* Defines the plural rules for given country or language.
*
* @param country country or region
* @param numType numerical category
* @return {@code PluralRules}-instance (maybe a default setting)
* @since 2.2
*/
/*[deutsch]
* Definiert die Pluralregeln für das angegebene Land.
*
* @param country country or region
* @param numType numerical category
* @return {@code PluralRules}-instance (maybe a default setting)
* @since 2.2
*/
PluralRules load(
Locale country,
NumberType numType
);
}