Class PDF417ErrorCorrection


  • final class PDF417ErrorCorrection
    extends java.lang.Object
    PDF417 error correction code following the algorithm described in ISO/IEC 15438:2001(E) in chapter 4.10.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int[][] EC_COEFFICIENTS
      Tables of coefficients for calculating error correction words (see annex F, ISO/IEC 15438:2001(E))
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static java.lang.String generateErrorCorrection​(java.lang.CharSequence dataCodewords, int errorCorrectionLevel)
      Generates the error correction codewords according to 4.10 in ISO/IEC 15438:2001(E).
      (package private) static int getErrorCorrectionCodewordCount​(int errorCorrectionLevel)
      Determines the number of error correction codewords for a specified error correction level.
      (package private) static int getRecommendedMinimumErrorCorrectionLevel​(int n)
      Returns the recommended minimum error correction level as described in annex E of ISO/IEC 15438:2001(E).
      • Methods inherited from class java.lang.Object

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

      • EC_COEFFICIENTS

        private static final int[][] EC_COEFFICIENTS
        Tables of coefficients for calculating error correction words (see annex F, ISO/IEC 15438:2001(E))
    • Constructor Detail

      • PDF417ErrorCorrection

        private PDF417ErrorCorrection()
    • Method Detail

      • getErrorCorrectionCodewordCount

        static int getErrorCorrectionCodewordCount​(int errorCorrectionLevel)
        Determines the number of error correction codewords for a specified error correction level.
        Parameters:
        errorCorrectionLevel - the error correction level (0-8)
        Returns:
        the number of codewords generated for error correction
      • getRecommendedMinimumErrorCorrectionLevel

        static int getRecommendedMinimumErrorCorrectionLevel​(int n)
                                                      throws WriterException
        Returns the recommended minimum error correction level as described in annex E of ISO/IEC 15438:2001(E).
        Parameters:
        n - the number of data codewords
        Returns:
        the recommended minimum error correction level
        Throws:
        WriterException
      • generateErrorCorrection

        static java.lang.String generateErrorCorrection​(java.lang.CharSequence dataCodewords,
                                                        int errorCorrectionLevel)
        Generates the error correction codewords according to 4.10 in ISO/IEC 15438:2001(E).
        Parameters:
        dataCodewords - the data codewords
        errorCorrectionLevel - the error correction level (0-8)
        Returns:
        the String representing the error correction codewords