- All Implemented Interfaces:
Serializable
,Comparable<CrcSize>
,java.lang.constant.Constable
,CrcWidthAccessor
public enum CrcSize extends Enum<CrcSize> implements CrcWidthAccessor
Enumeration with CRC implementations hacked together from sources "out
there".
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface org.refcodes.numerical.CrcWidthAccessor
CrcWidthAccessor.CrcWidthBuilder<B extends CrcWidthAccessor.CrcWidthBuilder<B>>, CrcWidthAccessor.CrcWidthMutator, CrcWidthAccessor.CrcWidthProperty
-
Enum Constant Summary
-
Method Summary
Modifier and Type Method Description CrcAlgorithmConfig[]
getCrcAlgorithms()
Retrieves theCrcAlgorithmConfig
implementations as of the accordingCrcSize
.int
getCrcWidth()
Retrieves the value from the CRC byte width (number of bytes used to store a CRC checksum) property.static CrcSize
toCrcCategory(int aCrcByteWidth)
Retrieves theCrcSize
representing the queried "byte length".static CrcSize
valueOf(String name)
Returns the enum constant of this type with the specified name.static CrcSize[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CRC_8
-
CRC_16
-
CRC_32
-
CRC_64
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
getCrcWidth
public int getCrcWidth()Retrieves the value from the CRC byte width (number of bytes used to store a CRC checksum) property.- Specified by:
getCrcWidth
in interfaceCrcWidthAccessor
- Returns:
- The name stored by the CRC byte width (number of bytes used to store a CRC checksum) property.
-
getCrcAlgorithms
Retrieves theCrcAlgorithmConfig
implementations as of the accordingCrcSize
.- Returns:
- The
CrcAlgorithmConfig
implementations with the according checksum's "CRC byte length"
-
toCrcCategory
Retrieves theCrcSize
representing the queried "byte length".
-