Class BarCodeResult

  • java.lang.Object
    • com.aspose.barcode.barcoderecognition.BarCodeResult

  • public final class BarCodeResult
    extends java.lang.Object

    Stores recognized barcode data like SingleDecodeType type, string codetext, BarCodeRegionParameters region and other parameters

     This sample shows how to obtain BarCodeResult.
     BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code128, "12345");"c:\\test.png");
     BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.CODE_39_STANDARD, DecodeType.CODE_128);
     for(BarCodeResult result : reader.readBarCodes())
         System.out.println("BarCode Type: " + result.getCodeTypeName());
         System.out.println("BarCode CodeText: " + result.getCodeText());
         System.out.println("BarCode Confidence: " + result.getConfidence());
         System.out.println("BarCode ReadingQuality: " + result.getReadingQuality());
         System.out.println("BarCode Angle: " + result.getRegion().getAngle());
    • Constructor Summary

      Constructor and Description
      BarCodeResult(BarCodeResult result)
      Creates a a copy of the BarCodeResult class.
      BarCodeResult(com.aspose.barcode.barcoderecognition.recognition.recognitionsession.coderesult.CodeResult aResult)
      Creates a new instance of the BarCodeResult class with data accepted from CodeResult class
    • Constructor Detail

      • BarCodeResult

        public BarCodeResult(BarCodeResult result)

        Creates a a copy of the BarCodeResult class.

        result - An copy BarCodeResult instance.
      • BarCodeResult

        public BarCodeResult(com.aspose.barcode.barcoderecognition.recognition.recognitionsession.coderesult.CodeResult aResult)

        Creates a new instance of the BarCodeResult class with data accepted from CodeResult class

        aResult - An internal recognized barcode data
    • Method Detail

      • getReadingQuality

        public double getReadingQuality()

        Gets the reading quality. Works for 1D and postal barcodes.

        Value: The reading quality percent
      • getConfidence

        public int getConfidence()

        Gets recognition confidence level of the recognized barcode

        Value: BarCodeConfidence.Strong does not have fakes or misrecognitions, BarCodeConfidence.Moderate could sometimes have fakes or incorrect codetext because this confidence level for barcodews with weak cheksum or even without it, BarCodeConfidence.None always has incorrect codetext and could be fake recognitions
      • getCodeText

        public java.lang.String getCodeText()

        Gets the code text

        Value: The code text of the barcode
      • getCodeBytes

        public byte[] getCodeBytes()

        Gets the encoded code bytes

        Value: The code bytes of the barcode
      • getCodeType

        public SingleDecodeType getCodeType()

        Gets the barcode type

        Value: The type information of the recognized barcode
      • getCodeTypeName

        public java.lang.String getCodeTypeName()

        Gets the name of the barcode type

        Value: The type name of the recognized barcode
      • getRegion

        public BarCodeRegionParameters getRegion()

        Gets the barcode region

        Value: The region of the recognized barcode
      • getExtended

        public BarCodeExtendedParameters getExtended()

        Gets extended parameters of recognized barcode

        Value: The extended parameters of recognized barcode
      • getCodeText

        public java.lang.String getCodeText(java.nio.charset.Charset encoding)

        Gets the code text with encoding.

        encoding - The encoding for codetext.
        A string containing recognized code text.
      • equals

        public boolean equals(java.lang.Object obj)

        Returns a value indicating whether this instance is equal to a specified BarCodeResult value.

        equals in class java.lang.Object
        obj - An BarCodeResult value to compare to this instance.
        <b>true</b> if obj has the same value as this instance; otherwise, <b>false</b>.
      • hashCode

        public int hashCode()

        Returns the hash code for this instance.

        hashCode in class java.lang.Object
        A 32-bit signed integer hash code.
      • toString

        public java.lang.String toString()

        Returns a human-readable string representation of this BarCodeResult.

        toString in class java.lang.Object
        A string that represents this BarCodeResult.
      • deepClone

        public java.lang.Object deepClone()

        Creates a copy of BarCodeResult class.

        Returns copy of BarCodeResult class.