public enum BaseConfig extends Enum<BaseConfig> implements BaseMetrics
BaseMetrics
to be
used by a BaseBuilder
, a BaseDecoder
, a BaseEncoder
or the like..org.refcodes.mixin.CharSetAccessor.CharSetBuilder<B extends org.refcodes.mixin.CharSetAccessor.CharSetBuilder<B>>, org.refcodes.mixin.CharSetAccessor.CharSetMutator, org.refcodes.mixin.CharSetAccessor.CharSetProperty
org.refcodes.numerical.PaddingCharAccessor.PaddingCharBuilder<B extends org.refcodes.numerical.PaddingCharAccessor.PaddingCharBuilder<B>>, org.refcodes.numerical.PaddingCharAccessor.PaddingCharMutator, org.refcodes.numerical.PaddingCharAccessor.PaddingCharProperty
org.refcodes.numerical.NumberBaseAccessor.NumberBaseBuilder<B extends org.refcodes.numerical.NumberBaseAccessor.NumberBaseBuilder<B>>, org.refcodes.numerical.NumberBaseAccessor.NumberBaseMutator, org.refcodes.numerical.NumberBaseAccessor.NumberBaseProperty
Enum Constant and Description |
---|
BASE16 |
BASE2 |
BASE32 |
BASE4 |
BASE64 |
BASE64_ARABIC |
BASE64_URL |
BASE8 |
BINARY |
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.
|
HEXADECIMAL |
OCTAL |
Modifier and Type | Method and Description |
---|---|
int |
getBitsPerDigit()
Number in bits for one digit.
|
int |
getBytesPerInt()
Number of bytes to exactly store a minimum number of digits.
|
char[] |
getCharSet()
Character set to be used by the given enumeration.
|
int |
getDigitMask()
The digit mask is the bit-field covering just the digit's bits (starting
at bit 0).
|
int |
getDigitsPerByte()
Number of digits required to represent a byte.
|
int |
getDigitsPerInt()
Number of digits stored in an integer.
|
int |
getNumberBase() |
char |
getPaddingChar() |
static BaseMetrics |
toBaseCodec(int aNumberBase)
To base codec.
|
char |
toChar(int aValue)
Retrieves the (encoded) character for the (decoded) value.
|
String |
toString() |
int |
toValue(char aChar)
Retrieves the (decoded) value for the (encoded) character.
|
static BaseConfig |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BaseConfig[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BaseConfig BASE2
public static final BaseConfig BINARY
public static final BaseConfig BASE4
public static final BaseConfig BASE8
public static final BaseConfig OCTAL
public static final BaseConfig ENCODED_AS_NUMBER
public static final BaseConfig BASE16
public static final BaseConfig HEXADECIMAL
public static final BaseConfig BASE32
public static final BaseConfig BASE64
public static final BaseConfig BASE64_ARABIC
public static final BaseConfig BASE64_URL
public static BaseConfig[] values()
for (BaseConfig c : BaseConfig.values()) System.out.println(c);
public static BaseConfig valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getNumberBase()
getNumberBase
in interface org.refcodes.numerical.NumberBaseAccessor
public char[] getCharSet()
BaseMetrics
getCharSet
in interface BaseMetrics
getCharSet
in interface org.refcodes.mixin.CharSetAccessor
public int getBytesPerInt()
BaseMetrics
getBytesPerInt
in interface BaseMetrics
public int getDigitsPerInt()
BaseMetrics
getDigitsPerInt
in interface BaseMetrics
public int getBitsPerDigit()
BaseMetrics
getBitsPerDigit
in interface BaseMetrics
public int getDigitsPerByte()
BaseMetrics
getDigitsPerByte
in interface BaseMetrics
public int getDigitMask()
BaseMetrics
getDigitMask
in interface BaseMetrics
public static BaseMetrics toBaseCodec(int aNumberBase)
aNumberBase
- the a number basepublic int toValue(char aChar)
BaseMetrics
toValue
in interface BaseMetrics
aChar
- the a charpublic char toChar(int aValue)
BaseMetrics
toChar
in interface BaseMetrics
aValue
- the a valuepublic char getPaddingChar()
getPaddingChar
in interface org.refcodes.numerical.PaddingCharAccessor
public String toString()
toString
in class Enum<BaseConfig>
Copyright © 2017. All rights reserved.