Class HighLevelEncoder


  • public final class HighLevelEncoder
    extends java.lang.Object
    DataMatrix ECC 200 data encoder following the algorithm described in ISO/IEC 16022:200(E) in annex S.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private HighLevelEncoder()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int determineConsecutiveDigitCount​(java.lang.CharSequence msg, int startpos)
      Determines the number of consecutive characters that are encodable using numeric compaction.
      static java.lang.String encodeHighLevel​(java.lang.String msg)
      Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).
      static java.lang.String encodeHighLevel​(java.lang.String msg, SymbolShapeHint shape, Dimension minSize, Dimension maxSize)
      Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).
      static java.lang.String encodeHighLevel​(java.lang.String msg, SymbolShapeHint shape, Dimension minSize, Dimension maxSize, boolean forceC40)
      Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).
      private static int findMinimums​(float[] charCounts, int[] intCharCounts, int min, byte[] mins)  
      private static int getMinimumCount​(byte[] mins)  
      (package private) static void illegalCharacter​(char c)  
      (package private) static boolean isDigit​(char ch)  
      (package private) static boolean isExtendedASCII​(char ch)  
      (package private) static boolean isNativeC40​(char ch)  
      (package private) static boolean isNativeEDIFACT​(char ch)  
      (package private) static boolean isNativeText​(char ch)  
      (package private) static boolean isNativeX12​(char ch)  
      private static boolean isSpecialB256​(char ch)  
      private static boolean isX12TermSep​(char ch)  
      (package private) static int lookAheadTest​(java.lang.CharSequence msg, int startpos, int currentMode)  
      (package private) static int lookAheadTestIntern​(java.lang.CharSequence msg, int startpos, int currentMode)  
      private static int min​(int f1, int f2, int f3, int f4)  
      private static int min​(int f1, int f2, int f3, int f4, int f5)  
      private static char randomize253State​(int codewordPosition)  
      • Methods inherited from class java.lang.Object

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

      • HighLevelEncoder

        private HighLevelEncoder()
    • Method Detail

      • randomize253State

        private static char randomize253State​(int codewordPosition)
      • encodeHighLevel

        public static java.lang.String encodeHighLevel​(java.lang.String msg)
        Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).
        Parameters:
        msg - the message
        Returns:
        the encoded message (the char values range from 0 to 255)
      • encodeHighLevel

        public static java.lang.String encodeHighLevel​(java.lang.String msg,
                                                       SymbolShapeHint shape,
                                                       Dimension minSize,
                                                       Dimension maxSize)
        Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).
        Parameters:
        msg - the message
        shape - requested shape. May be SymbolShapeHint.FORCE_NONE, SymbolShapeHint.FORCE_SQUARE or SymbolShapeHint.FORCE_RECTANGLE.
        minSize - the minimum symbol size constraint or null for no constraint
        maxSize - the maximum symbol size constraint or null for no constraint
        Returns:
        the encoded message (the char values range from 0 to 255)
      • encodeHighLevel

        public static java.lang.String encodeHighLevel​(java.lang.String msg,
                                                       SymbolShapeHint shape,
                                                       Dimension minSize,
                                                       Dimension maxSize,
                                                       boolean forceC40)
        Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).
        Parameters:
        msg - the message
        shape - requested shape. May be SymbolShapeHint.FORCE_NONE, SymbolShapeHint.FORCE_SQUARE or SymbolShapeHint.FORCE_RECTANGLE.
        minSize - the minimum symbol size constraint or null for no constraint
        maxSize - the maximum symbol size constraint or null for no constraint
        forceC40 - enforce C40 encoding
        Returns:
        the encoded message (the char values range from 0 to 255)
      • lookAheadTest

        static int lookAheadTest​(java.lang.CharSequence msg,
                                 int startpos,
                                 int currentMode)
      • lookAheadTestIntern

        static int lookAheadTestIntern​(java.lang.CharSequence msg,
                                       int startpos,
                                       int currentMode)
      • min

        private static int min​(int f1,
                               int f2,
                               int f3,
                               int f4,
                               int f5)
      • min

        private static int min​(int f1,
                               int f2,
                               int f3,
                               int f4)
      • findMinimums

        private static int findMinimums​(float[] charCounts,
                                        int[] intCharCounts,
                                        int min,
                                        byte[] mins)
      • getMinimumCount

        private static int getMinimumCount​(byte[] mins)
      • isDigit

        static boolean isDigit​(char ch)
      • isExtendedASCII

        static boolean isExtendedASCII​(char ch)
      • isNativeC40

        static boolean isNativeC40​(char ch)
      • isNativeText

        static boolean isNativeText​(char ch)
      • isNativeX12

        static boolean isNativeX12​(char ch)
      • isX12TermSep

        private static boolean isX12TermSep​(char ch)
      • isNativeEDIFACT

        static boolean isNativeEDIFACT​(char ch)
      • isSpecialB256

        private static boolean isSpecialB256​(char ch)
      • determineConsecutiveDigitCount

        public static int determineConsecutiveDigitCount​(java.lang.CharSequence msg,
                                                         int startpos)
        Determines the number of consecutive characters that are encodable using numeric compaction.
        Parameters:
        msg - the message
        startpos - the start position within the message
        Returns:
        the requested character count
      • illegalCharacter

        static void illegalCharacter​(char c)