Class EightToSixDotMapper


  • public class EightToSixDotMapper
    extends java.lang.Object
    Provides a utility to map eight dot patterns to six dot patterns. If the resulting patterns are aligned without any row spacing, the patterns will appear the same as the original 8-dot patterns. This can be useful when printing 8-dot files to an embosser using a 6-dot table.
    Author:
    Joel HÃ¥kansson
    • Constructor Summary

      Constructors 
      Constructor Description
      EightToSixDotMapper​(int width)
      Creates a new SixDotMapper with the specified line length
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void flush()
      Flushes the last line of characters.
      boolean hasMoreFullLines()  
      boolean hasMoreLines()  
      void newLine​(int rowgap)
      Starts a new line
      java.lang.String readLine()
      Reads a line from the output buffer.
      void write​(java.lang.String braille)
      Writes a string of braille.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EightToSixDotMapper

        public EightToSixDotMapper​(int width)
        Creates a new SixDotMapper with the specified line length
        Parameters:
        width - the length of the lines, in characters
    • Method Detail

      • write

        public void write​(java.lang.String braille)
        Writes a string of braille. Values must be between 0x2800 and 0x28FF.
        Parameters:
        braille - characters in the range 0x2800 to 0x28FF
        Throws:
        java.lang.IllegalArgumentException - if the number of characters exceeds the line width
      • newLine

        public void newLine​(int rowgap)
        Starts a new line
        Parameters:
        rowgap - the row gap following the line currently in the buffer
      • flush

        public void flush()
        Flushes the last line of characters. This will empty the buffer.
      • hasMoreFullLines

        public boolean hasMoreFullLines()
      • hasMoreLines

        public boolean hasMoreLines()
      • readLine

        public java.lang.String readLine()
        Reads a line from the output buffer. When the last line is read, the grid alignment resets (the characters are padded to their full 6-dot height).
        Returns:
        returns the line or null if the buffer is empty