Enum Class BaseMetricsConfig
- All Implemented Interfaces:
Serializable,Comparable<BaseMetricsConfig>,Constable,BaseMetrics,org.refcodes.mixin.CharSetAccessor,org.refcodes.numerical.NumberBaseAccessor,org.refcodes.numerical.PaddingCharAccessor
This enumeration provides access to preconfigured
BaseMetrics to be
used by a BaseBuilder, a BaseDecoder, a BaseEncoder
or the like..-
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.mixin.CharSetAccessor
org.refcodes.mixin.CharSetAccessor.CharSetBuilder<B extends org.refcodes.mixin.CharSetAccessor.CharSetBuilder<B>>, org.refcodes.mixin.CharSetAccessor.CharSetMutator, org.refcodes.mixin.CharSetAccessor.CharSetPropertyNested classes/interfaces inherited from interface org.refcodes.numerical.NumberBaseAccessor
org.refcodes.numerical.NumberBaseAccessor.NumberBaseBuilder<B extends org.refcodes.numerical.NumberBaseAccessor.NumberBaseBuilder<B>>, org.refcodes.numerical.NumberBaseAccessor.NumberBaseMutator, org.refcodes.numerical.NumberBaseAccessor.NumberBasePropertyNested classes/interfaces inherited from interface org.refcodes.numerical.PaddingCharAccessor
org.refcodes.numerical.PaddingCharAccessor.PaddingCharBuilder<B extends org.refcodes.numerical.PaddingCharAccessor.PaddingCharBuilder<B>>, org.refcodes.numerical.PaddingCharAccessor.PaddingCharMutator, org.refcodes.numerical.PaddingCharAccessor.PaddingCharProperty -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUse this encoding when you want to retrieve a "valid" number *not* beginning with a zero "0" and just consisting of the numbers 0 to 9. -
Method Summary
Modifier and TypeMethodDescriptionintNumber in bits for one digit.intNumber of bytes to exactly fit into an encoded block.intNumber of bytes to exactly store a minimum number of digits.char[]intThe digit mask is the bit-field covering just the digit's bits (starting at bit 0).intNumber of digits required to represent a byte.intNumber of digits stored in an integer.intcharstatic BaseMetricstoBaseCodec(int aNumberBase) To base codec.chartoChar(int aValue) Retrieves the (encoded) character for the (decoded) value.inttoValue(char aChar) Retrieves the (decoded) value for the (encoded) character.static BaseMetricsConfigReturns the enum constant of this class with the specified name.static BaseMetricsConfig[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface org.refcodes.codec.BaseMetrics
getDigitsPerBlock, toPaddingChars, toPaddingCharsNumber
-
Enum Constant Details
-
BASE2
-
BINARY
-
BASE4
-
BASE8
-
OCTAL
-
ENCODED_AS_NUMBER
Use this encoding when you want to retrieve a "valid" number *not* beginning with a zero "0" and just consisting of the numbers 0 to 9. E.g. when a "number" variable is to be encoded and still must look like a number without any prefixed "0" chars. "0" is used as padding char being suffixed. -
BASE16
-
HEXADECIMAL
-
BASE32
-
BASE64
-
BASE64_ARABIC
-
BASE64_URL
-
-
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
-
getNumberBase
public int getNumberBase()- Specified by:
getNumberBasein interfaceorg.refcodes.numerical.NumberBaseAccessor
-
getCharSet
public char[] getCharSet()- Specified by:
getCharSetin interfaceBaseMetrics- Specified by:
getCharSetin interfaceorg.refcodes.mixin.CharSetAccessor
-
getBytesPerInt
public int getBytesPerInt()Number of bytes to exactly store a minimum number of digits.- Specified by:
getBytesPerIntin interfaceBaseMetrics- Returns:
- the bytes per int
-
getDigitsPerInt
public int getDigitsPerInt()Number of digits stored in an integer.- Specified by:
getDigitsPerIntin interfaceBaseMetrics- Returns:
- the digits per int
-
getBitsPerDigit
public int getBitsPerDigit()Number in bits for one digit.- Specified by:
getBitsPerDigitin interfaceBaseMetrics- Returns:
- the bits per digit
-
getDigitsPerByte
public int getDigitsPerByte()Number of digits required to represent a byte.- Specified by:
getDigitsPerBytein interfaceBaseMetrics- Returns:
- the digits per byte
-
getDigitMask
public int getDigitMask()The digit mask is the bit-field covering just the digit's bits (starting at bit 0). Those bits in the mask are set to one which are required to represent a digit.- Specified by:
getDigitMaskin interfaceBaseMetrics- Returns:
- the digit mask
-
toBaseCodec
To base codec.- Parameters:
aNumberBase- the number base- Returns:
- the base metrics
-
toValue
public int toValue(char aChar) Retrieves the (decoded) value for the (encoded) character.- Specified by:
toValuein interfaceBaseMetrics- Parameters:
aChar- the char- Returns:
- the int
-
toChar
public char toChar(int aValue) Retrieves the (encoded) character for the (decoded) value.- Specified by:
toCharin interfaceBaseMetrics- Parameters:
aValue- the value- Returns:
- the char
-
getPaddingChar
public char getPaddingChar()- Specified by:
getPaddingCharin interfaceorg.refcodes.numerical.PaddingCharAccessor
-
getBytesPerBlock
public int getBytesPerBlock()Number of bytes to exactly fit into an encoded block.- Specified by:
getBytesPerBlockin interfaceBaseMetrics- Returns:
- the bytes per block
-