public class CompoundHyphenator extends AbstractHyphenator
Hyphenator
that dispatches to sub-hyphenators based on locale.AbstractHyphenator.util
Hyphenator.FullHyphenator, Hyphenator.LineBreaker, Hyphenator.LineIterator, Hyphenator.NonStandardHyphenationException
Constructor and Description |
---|
CompoundHyphenator(Map<org.daisy.braille.css.LanguageRange,Supplier<Hyphenator>> subHyphenators,
Hyphenator fallbackHyphenator) |
Modifier and Type | Method and Description |
---|---|
Hyphenator.FullHyphenator |
asFullHyphenator()
Indicate all soft wrap opportunities by inserting soft hyphens and zero width
spaces.
|
Hyphenator.LineBreaker |
asLineBreaker()
Break the input into lines of a preferred and maximal length.
|
com.google.common.base.MoreObjects.ToStringHelper |
toStringHelper() |
finalize, getIdentifier, toString
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getIdentifier
public CompoundHyphenator(Map<org.daisy.braille.css.LanguageRange,Supplier<Hyphenator>> subHyphenators, Hyphenator fallbackHyphenator)
subHyphenators
- ordered map of language ranges to Hyphenator
sfallbackHyphenator
- hyphenator to use when no sub-hyphenator matchespublic com.google.common.base.MoreObjects.ToStringHelper toStringHelper()
toStringHelper
in class AbstractTransform
public Hyphenator.FullHyphenator asFullHyphenator() throws UnsupportedOperationException
Hyphenator
asFullHyphenator
in interface Hyphenator
asFullHyphenator
in class AbstractHyphenator
UnsupportedOperationException
- if any of the sub-hyphenators throws an UnsupportedOperationException
public Hyphenator.LineBreaker asLineBreaker() throws UnsupportedOperationException
Hyphenator
Hyphenator.LineBreaker
is not required to do any special white space processing, but
it may.
If the Hyphenator.FullHyphenator
returned by Hyphenator.asFullHyphenator()
throws a Hyphenator.NonStandardHyphenationException
, the Hyphenator.asLineBreaker()
method must not throw a UnsupportedOperationException
.asLineBreaker
in interface Hyphenator
asLineBreaker
in class AbstractHyphenator
UnsupportedOperationException
- if any of the sub-hyphenators throws an UnsupportedOperationException
Copyright © 2010–2024 The DAISY Consortium. All rights reserved.