Path: blob/master/src/java.base/share/classes/java/text/spi/BreakIteratorProvider.java
41159 views
/*1* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.text.spi;2627import java.text.BreakIterator;28import java.util.Locale;29import java.util.spi.LocaleServiceProvider;3031/**32* An abstract class for service providers that33* provide concrete implementations of the34* {@link java.text.BreakIterator BreakIterator} class.35*36* @since 1.637*/38public abstract class BreakIteratorProvider extends LocaleServiceProvider {3940/**41* Sole constructor. (For invocation by subclass constructors, typically42* implicit.)43*/44protected BreakIteratorProvider() {45}4647/**48* Returns a new {@code BreakIterator} instance49* for <a href="../BreakIterator.html#word">word breaks</a>50* for the given locale.51* @param locale the desired locale52* @return A break iterator for word breaks53* @throws NullPointerException if {@code locale} is null54* @throws IllegalArgumentException if {@code locale} isn't55* one of the locales returned from56* {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()57* getAvailableLocales()}.58* @see java.text.BreakIterator#getWordInstance(java.util.Locale)59*/60public abstract BreakIterator getWordInstance(Locale locale);6162/**63* Returns a new {@code BreakIterator} instance64* for <a href="../BreakIterator.html#line">line breaks</a>65* for the given locale.66* @param locale the desired locale67* @return A break iterator for line breaks68* @throws NullPointerException if {@code locale} is null69* @throws IllegalArgumentException if {@code locale} isn't70* one of the locales returned from71* {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()72* getAvailableLocales()}.73* @see java.text.BreakIterator#getLineInstance(java.util.Locale)74*/75public abstract BreakIterator getLineInstance(Locale locale);7677/**78* Returns a new {@code BreakIterator} instance79* for <a href="../BreakIterator.html#character">character breaks</a>80* for the given locale.81* @param locale the desired locale82* @return A break iterator for character breaks83* @throws NullPointerException if {@code locale} is null84* @throws IllegalArgumentException if {@code locale} isn't85* one of the locales returned from86* {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()87* getAvailableLocales()}.88* @see java.text.BreakIterator#getCharacterInstance(java.util.Locale)89*/90public abstract BreakIterator getCharacterInstance(Locale locale);9192/**93* Returns a new {@code BreakIterator} instance94* for <a href="../BreakIterator.html#sentence">sentence breaks</a>95* for the given locale.96* @param locale the desired locale97* @return A break iterator for sentence breaks98* @throws NullPointerException if {@code locale} is null99* @throws IllegalArgumentException if {@code locale} isn't100* one of the locales returned from101* {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()102* getAvailableLocales()}.103* @see java.text.BreakIterator#getSentenceInstance(java.util.Locale)104*/105public abstract BreakIterator getSentenceInstance(Locale locale);106}107108109