Class Code128Writer

    • Constructor Detail

      • Code128Writer

        public Code128Writer()
    • Method Detail

      • encode

        public boolean[] encode​(java.lang.String contents)
        Description copied from class: OneDimensionalCodeWriter
        Encode the contents to boolean array expression of one-dimensional barcode. Start code and end code should be included in result, and side margins should not be included.
        Specified by:
        encode in class OneDimensionalCodeWriter
        Parameters:
        contents - barcode contents to encode
        Returns:
        a boolean[] of horizontal pixels (false = white, true = black)
      • encode

        public boolean[] encode​(java.lang.String contents,
                                java.util.Map<EncodeHintType,​?> hints)
        Description copied from class: OneDimensionalCodeWriter
        Can be overwritten if the encode requires to read the hints map. Otherwise it defaults to encode.
        Overrides:
        encode in class OneDimensionalCodeWriter
        Parameters:
        contents - barcode contents to encode
        hints - encoding hints
        Returns:
        a boolean[] of horizontal pixels (false = white, true = black)
      • check

        private static int check​(java.lang.String contents,
                                 java.util.Map<EncodeHintType,​?> hints)
      • encodeFast

        private static boolean[] encodeFast​(java.lang.String contents,
                                            int forcedCodeSet)
      • produceResult

        static boolean[] produceResult​(java.util.Collection<int[]> patterns,
                                       int checkSum)
      • findCType

        private static Code128Writer.CType findCType​(java.lang.CharSequence value,
                                                     int start)
      • chooseCode

        private static int chooseCode​(java.lang.CharSequence value,
                                      int start,
                                      int oldCode)