Package org.daisy.braille.table
Class EmbosserBrailleConverter
java.lang.Object
org.daisy.braille.table.EmbosserBrailleConverter
- All Implemented Interfaces:
BrailleConverter
Provides a simple TableConverter implementation. It
provides a one-to-one mapping between braille and
text and vice versa.
- Author:
- Joel HÃ¥kansson
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the fallback action when a character in the range 0x2840-0x28FF is encountered. -
Constructor Summary
ConstructorsConstructorDescriptionEmbosserBrailleConverter(String table, Charset charset, EmbosserBrailleConverter.EightDotFallbackMethod fallback, char replacement, boolean ignoreCase) Creates a new EmbosserBrailleConverter -
Method Summary
Modifier and TypeMethodDescriptionGets the preferred charset for this braille format when reading/writing as text from/to filebooleanReturns true if 8-dot braille is supported, false otherwiseTranscodes the given text string as braille.Transcodes the given braille into text.
-
Constructor Details
-
EmbosserBrailleConverter
public EmbosserBrailleConverter(String table, Charset charset, EmbosserBrailleConverter.EightDotFallbackMethod fallback, char replacement, boolean ignoreCase) Creates a new EmbosserBrailleConverter- Parameters:
table- the characters in the table, in Unicode order. Must contain 64 or 256 characters.charset- the preferred charset as defined in the BrailleConverter interfacefallback- the fallback method to use when encountering a character in the range 0x2840-0x28FFreplacement- the replacement character, must be in the range 0x2800-0x283FignoreCase- set to true to ignore character case
-
-
Method Details
-
getPreferredCharset
Description copied from interface:BrailleConverterGets the preferred charset for this braille format when reading/writing as text from/to file- Specified by:
getPreferredCharsetin interfaceBrailleConverter- Returns:
- returns the preferred charset
-
supportsEightDot
public boolean supportsEightDot()Description copied from interface:BrailleConverterReturns true if 8-dot braille is supported, false otherwise- Specified by:
supportsEightDotin interfaceBrailleConverter- Returns:
- returns true if 8-dot braille is supported, false otherwise
-
toBraille
Description copied from interface:BrailleConverterTranscodes the given text string as braille. This may be a one-to-one mapping or a many-to-one depending on the table implementation.- Specified by:
toBraillein interfaceBrailleConverter- Returns:
- returns a Unicode string of braille
-
toText
Description copied from interface:BrailleConverterTranscodes the given braille into text. In most cases this will reverse the effect of toBraille(String text), i.e. text.equals(toText(toBraille(text))), however an implementation cannot rely on it. Values must be between 0x2800 and 0x28FF.- Specified by:
toTextin interfaceBrailleConverter- Returns:
- returns a text string
-