- All Implemented Interfaces:
Serializable,Comparable<AztecSize>,Constable
Aztec sizes are defined by ISO/IEC 24778 and include both normal and compact variants. Normal variants have 1 to 32 layers with sizes ranging from 19x19 to 151x151 modules. Compact variants have 1 to 4 layers with sizes ranging from 15x15 to 27x27 modules.
All Aztec symbols are square. In contrast to other 2D codes Aztec does not require a quiet zone as its bullseye finder pattern enables reliable detection without surrounding white space.
The special constant AUTO allows automatic size selection, choosing the smallest symbol
that can accommodate the data to be encoded.
The unique layer counts (1 to 32 for normal sizes, -1 to -4 for compact sizes, 0 for AUTO)
assigned to the constants can be used as IDs for efficient storage in files or databases.
The numbers are small enough to be safely cast to signed byte if needed.
See getLayerCount() and valueOf(int layerCount).
-
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 dataAztec compact 1 (15x15 modules)Aztec compact 2 (19x19 modules)Aztec compact 3 (23x23 modules)Aztec compact 4 (27x27 modules)Aztec normal 1 (19x19 modules)Aztec normal 2 (23x23 modules)Aztec normal 3 (27x27 modules)Aztec normal 4 (31x31 modules)Aztec normal 5 (37x37 modules)Aztec normal 6 (41x41 modules)Aztec normal 7 (45x45 modules)Aztec normal 8 (49x49 modules)Aztec normal 9 (53x53 modules)Aztec normal 10 (57x57 modules)Aztec normal 11 (61x61 modules)Aztec normal 12 (67x67 modules)Aztec normal 13 (71x71 modules)Aztec normal 14 (75x75 modules)Aztec normal 15 (79x79 modules)Aztec normal 16 (83x83 modules)Aztec normal 17 (87x87 modules)Aztec normal 18 (91x91 modules)Aztec normal 19 (95x95 modules)Aztec normal 20 (101x101 modules)Aztec normal 21 (105x105 modules)Aztec normal 22 (109x109 modules)Aztec normal 23 (113x113 modules)Aztec normal 24 (117x117 modules)Aztec normal 25 (121x121 modules)Aztec normal 26 (125x125 modules)Aztec normal 27 (131x131 modules)Aztec normal 28 (135x135 modules)Aztec normal 29 (139x139 modules)Aztec normal 30 (143x143 modules)Aztec normal 31 (147x147 modules)Aztec normal 32 (151x151 modules) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the layer count corresponding to this Aztec size.intgetSize()Returns the symbol size (width/height in modules) of this Aztec size.booleanReturns true if this Aztec size represents a compact symbol.booleanisNormal()Returns true if this Aztec size represents a normal symbol.static AztecSizevalueOf(int layerCount) Returns the enum constant of this class corresponding to the specified layer count.static AztecSizeReturns the enum constant of this class with the specified name.static AztecSize[]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 -
COMPACT01
Aztec compact 1 (15x15 modules) -
COMPACT02
Aztec compact 2 (19x19 modules) -
COMPACT03
Aztec compact 3 (23x23 modules) -
COMPACT04
Aztec compact 4 (27x27 modules) -
NORMAL01
Aztec normal 1 (19x19 modules) -
NORMAL02
Aztec normal 2 (23x23 modules) -
NORMAL03
Aztec normal 3 (27x27 modules) -
NORMAL04
Aztec normal 4 (31x31 modules) -
NORMAL05
Aztec normal 5 (37x37 modules) -
NORMAL06
Aztec normal 6 (41x41 modules) -
NORMAL07
Aztec normal 7 (45x45 modules) -
NORMAL08
Aztec normal 8 (49x49 modules) -
NORMAL09
Aztec normal 9 (53x53 modules) -
NORMAL10
Aztec normal 10 (57x57 modules) -
NORMAL11
Aztec normal 11 (61x61 modules) -
NORMAL12
Aztec normal 12 (67x67 modules) -
NORMAL13
Aztec normal 13 (71x71 modules) -
NORMAL14
Aztec normal 14 (75x75 modules) -
NORMAL15
Aztec normal 15 (79x79 modules) -
NORMAL16
Aztec normal 16 (83x83 modules) -
NORMAL17
Aztec normal 17 (87x87 modules) -
NORMAL18
Aztec normal 18 (91x91 modules) -
NORMAL19
Aztec normal 19 (95x95 modules) -
NORMAL20
Aztec normal 20 (101x101 modules) -
NORMAL21
Aztec normal 21 (105x105 modules) -
NORMAL22
Aztec normal 22 (109x109 modules) -
NORMAL23
Aztec normal 23 (113x113 modules) -
NORMAL24
Aztec normal 24 (117x117 modules) -
NORMAL25
Aztec normal 25 (121x121 modules) -
NORMAL26
Aztec normal 26 (125x125 modules) -
NORMAL27
Aztec normal 27 (131x131 modules) -
NORMAL28
Aztec normal 28 (135x135 modules) -
NORMAL29
Aztec normal 29 (139x139 modules) -
NORMAL30
Aztec normal 30 (143x143 modules) -
NORMAL31
Aztec normal 31 (147x147 modules) -
NORMAL32
Aztec normal 32 (151x151 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 corresponding to the specified layer count.- Parameters:
layerCount- the layer count (1 to 32 for normal, -1 to -4 for compact, 0 for AUTO)- Returns:
- the enum constant corresponding to the specified layer count
- Throws:
IllegalArgumentException- if this enum class has no constant corresponding to the specified layer count
-
getLayerCount
public int getLayerCount()Returns the layer count corresponding to this Aztec size.Returns positive values (1 to 32) for normal sizes, negative values (-1 to -4) for compact sizes, or 0 for
AUTO.- Returns:
- the layer count corresponding to this Aztec size
- See Also:
-
getSize
public int getSize()Returns the symbol size (width/height in modules) of this Aztec size.- Returns:
- the symbol size (width/height in modules) of this Aztec size
-
isNormal
public boolean isNormal()Returns true if this Aztec size represents a normal symbol.- Returns:
- true if this Aztec size represents a normal symbol
-
isCompact
public boolean isCompact()Returns true if this Aztec size represents a compact symbol.- Returns:
- true if this Aztec size represents a compact symbol
-