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"); generator.save("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 and Description |
---|
BarCodeResult(BarCodeResult result)
Creates a a copy of the
BarCodeResult class. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
deepClone()
Creates a copy of
BarCodeResult class. |
boolean |
equals(java.lang.Object obj)
Returns a value indicating whether this instance is equal to a specified
BarCodeResult value. |
byte[] |
getCodeBytes()
Gets the encoded code bytes
|
java.lang.String |
getCodeText()
Gets the code text
|
java.lang.String |
getCodeText(java.nio.charset.Charset encoding)
Gets the code text with encoding.
|
SingleDecodeType |
getCodeType()
Gets the barcode type
|
java.lang.String |
getCodeTypeName()
Gets the name of the barcode type
|
int |
getConfidence()
Gets recognition confidence level of the recognized barcode
|
BarCodeExtendedParameters |
getExtended()
Gets extended parameters of recognized barcode
|
double |
getReadingQuality()
Gets the reading quality.
|
BarCodeRegionParameters |
getRegion()
Gets the barcode region
|
int |
hashCode()
Returns the hash code for this instance.
|
java.lang.String |
toString()
Returns a human-readable string representation of this
BarCodeResult . |
public BarCodeResult(BarCodeResult result)
Creates a a copy of the BarCodeResult
class.
result
- An copy BarCodeResult
instance.public double getReadingQuality()
Gets the reading quality. Works for 1D and postal barcodes.
Value: The reading quality percentpublic 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 recognitionspublic java.lang.String getCodeText()
Gets the code text
Value: The code text of the barcodepublic byte[] getCodeBytes()
Gets the encoded code bytes
Value: The code bytes of the barcodepublic SingleDecodeType getCodeType()
Gets the barcode type
Value: The type information of the recognized barcodepublic java.lang.String getCodeTypeName()
Gets the name of the barcode type
Value: The type name of the recognized barcodepublic BarCodeRegionParameters getRegion()
Gets the barcode region
Value: The region of the recognized barcodepublic BarCodeExtendedParameters getExtended()
Gets extended parameters of recognized barcode
Value: The extended parameters of recognized barcodepublic java.lang.String getCodeText(java.nio.charset.Charset encoding)
Gets the code text with encoding.
encoding
- The encoding for codetext.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>
.public int hashCode()
Returns the hash code for this instance.
hashCode
in class java.lang.Object
public java.lang.String toString()
Returns a human-readable string representation of this BarCodeResult
.
toString
in class java.lang.Object
BarCodeResult
.public java.lang.Object deepClone()
Creates a copy of BarCodeResult
class.
BarCodeResult
class.