- java.lang.Object
-
- java.lang.Enum<CrcSize>
-
- org.refcodes.numerical.CrcSize
-
- All Implemented Interfaces:
Serializable
,Comparable<CrcSize>
,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 interface org.refcodes.numerical.CrcWidthAccessor
CrcWidthAccessor.CrcWidthBuilder<B extends CrcWidthAccessor.CrcWidthBuilder<B>>, CrcWidthAccessor.CrcWidthMutator, CrcWidthAccessor.CrcWidthProperty
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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.
-
-
-
Method Detail
-
values
public static CrcSize[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CrcSize c : CrcSize.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CrcSize valueOf(String name)
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
public CrcAlgorithmConfig[] getCrcAlgorithms()
Retrieves theCrcAlgorithmConfig
implementations as of the accordingCrcSize
.- Returns:
- The
CrcAlgorithmConfig
implementations with the according checksum's "CRC byte length"
-
-