Package me.croabeast.takion.character
Enum Class DefaultCharacter
- All Implemented Interfaces:
Serializable,Comparable<DefaultCharacter>,java.lang.constant.Constable,CharacterInfo
An enumeration of default characters along with their associated display widths.
This enum implements CharacterInfo and provides a predefined list of characters
(letters, numbers, and symbols) with configurable length values for text formatting purposes.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionintCalculates the bold length of the character.static intgetLength(char character) Retrieves the display length for the specified character.toString()Returns a string representation of the default character, including its name, character value, and length.static DefaultCharacterReturns the enum constant of this class with the specified name.static DefaultCharacter[]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, valueOfMethods inherited from interface me.croabeast.takion.character.CharacterInfo
getCharacter, getLength
-
Enum Constant Details
-
A
-
a
-
B
-
b
-
C
-
c
-
D
-
d
-
E
-
e
-
F
-
f
-
G
-
g
-
H
-
h
-
I
-
i
-
J
-
j
-
K
-
k
-
L
-
l
-
M
-
m
-
N
-
n
-
O
-
o
-
P
-
p
-
Q
-
q
-
R
-
r
-
S
-
s
-
T
-
t
-
U
-
u
-
V
-
v
-
W
-
w
-
X
-
x
-
Y
-
y
-
Z
-
z
-
NUM_1
-
NUM_2
-
NUM_3
-
NUM_4
-
NUM_5
-
NUM_6
-
NUM_7
-
NUM_8
-
NUM_9
-
NUM_0
-
EXCLAMATION_POINT
-
AT_SYMBOL
-
NUM_SIGN
-
DOLLAR_SIGN
-
PERCENT
-
UP_ARROW
-
AMPERSAND
-
ASTERISK
-
LEFT_PARENTHESIS
-
RIGHT_PARENTHESIS
-
MINUS
-
UNDERSCORE
-
PLUS_SIGN
-
EQUALS_SIGN
-
LEFT_CURL_BRACE
-
RIGHT_CURL_BRACE
-
LEFT_BRACKET
-
RIGHT_BRACKET
-
COLON
-
SEMI_COLON
-
DOUBLE_QUOTE
-
SINGLE_QUOTE
-
LEFT_ARROW
-
RIGHT_ARROW
-
QUESTION_MARK
-
SLASH
-
BACK_SLASH
-
LINE
-
TILDE
-
TICK
-
PERIOD
-
COMMA
-
SPACE
-
-
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
-
getBoldLength
public int getBoldLength()Calculates the bold length of the character.This is computed as the base length plus an extra unit of length for non-space characters. For space characters, the bold length is equal to the base length.
- Specified by:
getBoldLengthin interfaceCharacterInfo- Returns:
- the bold length of the character
-
toString
Returns a string representation of the default character, including its name, character value, and length.- Overrides:
toStringin classEnum<DefaultCharacter>- Returns:
- a string representation of the character info
-
getLength
public static int getLength(char character) Retrieves the display length for the specified character.This static method iterates over the available default characters and returns the length for the matching character. If the character is not found, a length of 0 is returned.
- Parameters:
character- the character whose length is to be retrieved- Returns:
- the display length of the character, or 0 if the character is not defined
-