Enum Class «PDF417ErrorCorrection»
- All Implemented Interfaces:
Serializable,Comparable<PDF417ErrorCorrection>,Constable
PDF417 includes built-in error correction to recover from symbol damage. The error correction level determines how much data redundancy is added to the symbol. Higher levels provide better damage recovery but increase the symbol size.
PDF417 supports 9 error correction levels (0-8). Level 0 provides error detection only (no correction capability), while levels 1-8 provide increasing error correction capability with each level.
The unique level numbers (0-8) assigned to the constants can be used for efficient storage in
files or databases. The numbers are small enough to be safely cast to byte if needed.
See getLevelNumber() and valueOf(int levelNumber).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionPDF417 error correction level 0PDF417 error correction level 1PDF417 error correction level 2PDF417 error correction level 3PDF417 error correction level 4PDF417 error correction level 5PDF417 error correction level 6PDF417 error correction level 7PDF417 error correction level 8 -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of error correction codewords for this level.intReturns the level number (0-8) of this error correction level.static PDF417ErrorCorrectionvalueOf(int levelNumber) Returns the enum constant of this class associated with the specified level number.static PDF417ErrorCorrectionReturns the enum constant of this class with the specified name.static PDF417ErrorCorrection[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EC0
PDF417 error correction level 0 -
EC1
PDF417 error correction level 1 -
EC2
PDF417 error correction level 2 -
EC3
PDF417 error correction level 3 -
EC4
PDF417 error correction level 4 -
EC5
PDF417 error correction level 5 -
EC6
PDF417 error correction level 6 -
EC7
PDF417 error correction level 7 -
EC8
PDF417 error correction level 8
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
valueOf
Returns the enum constant of this class associated with the specified level number.- Parameters:
levelNumber- the level number of the enum constant to be returned (0-8)- Returns:
- the enum constant associated with the specified level number
- Throws:
IllegalArgumentException- if this enum class has no constant associated with the specified level number
-
getLevelNumber
public int getLevelNumber()Returns the level number (0-8) of this error correction level.- Returns:
- the level number (0-8) of this error correction level
- See Also:
-
getErrorCorrectionCodewords
public int getErrorCorrectionCodewords()Returns the number of error correction codewords for this level.According to ISO/IEC 15438, PDF417 uses 2^(level+1) error correction codewords, ranging from 2 at level 0 (detection only) to 512 at level 8 (maximum correction).
This value can be combined with
getLevelNumber()to create complete descriptions like "Level 3 (16 codewords)" for user interfaces or logging.- Returns:
- the number of error correction codewords for this level
-