- All Implemented Interfaces:
Serializable,Comparable<DataMatrixSize>,Constable
DataMatrix symbols are defined by ISO/IEC 16022. The ECC200 standard supports 30 symbol sizes ranging from 10x10 to 144x144 modules. Of these 30 sizes, 24 are square and 6 are rectangular. Rectangular symbols are designed for applications where the available space is distributed over, for example, a long, narrow or rounded surface.
Symbol sizes do not include the quiet zone and are sorted by width, then height.
The special constant AUTO allows automatic size selection, choosing the smallest symbol
that can accommodate the data to be encoded.
The unique integer IDs (0-30) assigned to the constants can be used for efficient storage in
files or databases. The IDs are small enough to be safely cast to byte if needed.
See getID() and valueOf(int id).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSelect optimal size based on dataDataMatrix size 1 (10x10 modules)DataMatrix size 2 (12x12 modules)DataMatrix size 3 (14x14 modules)DataMatrix size 4 (16x16 modules)DataMatrix size 5 (18x8 modules)DataMatrix size 6 (18x18 modules)DataMatrix size 7 (20x20 modules)DataMatrix size 8 (22x22 modules)DataMatrix size 9 (24x24 modules)DataMatrix size 10 (26x12 modules)DataMatrix size 11 (26x26 modules)DataMatrix size 12 (32x8 modules)DataMatrix size 13 (32x32 modules)DataMatrix size 14 (36x12 modules)DataMatrix size 15 (36x16 modules)DataMatrix size 16 (36x36 modules)DataMatrix size 17 (40x40 modules)DataMatrix size 18 (44x44 modules)DataMatrix size 19 (48x16 modules)DataMatrix size 20 (48x48 modules)DataMatrix size 21 (52x52 modules)DataMatrix size 22 (64x64 modules)DataMatrix size 23 (72x72 modules)DataMatrix size 24 (80x80 modules)DataMatrix size 25 (88x88 modules)DataMatrix size 26 (96x96 modules)DataMatrix size 27 (104x104 modules)DataMatrix size 28 (120x120 modules)DataMatrix size 29 (132x132 modules)DataMatrix size 30 (144x144 modules) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the symbol height in modules of this DataMatrix size.intgetID()Returns the integer ID associated with this DataMatrix size.intgetWidth()Returns the symbol width in modules of this DataMatrix size.booleanReturns true if this DataMatrix size represents a rectangular symbol.booleanisSquare()Returns true if this DataMatrix size represents a square symbol.static DataMatrixSizevalueOf(int id) Returns the enum constant of this class associated with the specified integer ID.static DataMatrixSizeReturns the enum constant of this class with the specified name.static DataMatrixSize[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTO
Select optimal size based on data -
S01
DataMatrix size 1 (10x10 modules) -
S02
DataMatrix size 2 (12x12 modules) -
S03
DataMatrix size 3 (14x14 modules) -
S04
DataMatrix size 4 (16x16 modules) -
S05
DataMatrix size 5 (18x8 modules) -
S06
DataMatrix size 6 (18x18 modules) -
S07
DataMatrix size 7 (20x20 modules) -
S08
DataMatrix size 8 (22x22 modules) -
S09
DataMatrix size 9 (24x24 modules) -
S10
DataMatrix size 10 (26x12 modules) -
S11
DataMatrix size 11 (26x26 modules) -
S12
DataMatrix size 12 (32x8 modules) -
S13
DataMatrix size 13 (32x32 modules) -
S14
DataMatrix size 14 (36x12 modules) -
S15
DataMatrix size 15 (36x16 modules) -
S16
DataMatrix size 16 (36x36 modules) -
S17
DataMatrix size 17 (40x40 modules) -
S18
DataMatrix size 18 (44x44 modules) -
S19
DataMatrix size 19 (48x16 modules) -
S20
DataMatrix size 20 (48x48 modules) -
S21
DataMatrix size 21 (52x52 modules) -
S22
DataMatrix size 22 (64x64 modules) -
S23
DataMatrix size 23 (72x72 modules) -
S24
DataMatrix size 24 (80x80 modules) -
S25
DataMatrix size 25 (88x88 modules) -
S26
DataMatrix size 26 (96x96 modules) -
S27
DataMatrix size 27 (104x104 modules) -
S28
DataMatrix size 28 (120x120 modules) -
S29
DataMatrix size 29 (132x132 modules) -
S30
DataMatrix size 30 (144x144 modules)
-
-
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 integer ID.- Parameters:
id- the ID of the enum constant to be returned (0 for AUTO, 1-30 for specific sizes)- Returns:
- the enum constant associated with the specified ID
- Throws:
IllegalArgumentException- if this enum class has no constant associated with the specified ID
-
getID
public int getID()Returns the integer ID associated with this DataMatrix size.Returns
0forAUTO, or1-30for specific sizes.- Returns:
- the integer ID associated with this DataMatrix size
- See Also:
-
getWidth
public int getWidth()Returns the symbol width in modules of this DataMatrix size.- Returns:
- the symbol width in modules of this DataMatrix size
-
getHeight
public int getHeight()Returns the symbol height in modules of this DataMatrix size.- Returns:
- the symbol height in modules of this DataMatrix size
-
isSquare
public boolean isSquare()Returns true if this DataMatrix size represents a square symbol.- Returns:
- true if this DataMatrix size represents a square symbol
-
isRectangle
public boolean isRectangle()Returns true if this DataMatrix size represents a rectangular symbol.- Returns:
- true if this DataMatrix size represents a rectangular symbol
-