Package me.croabeast.takion.character
Enum Class SmallCaps
- All Implemented Interfaces:
Serializable,Comparable<SmallCaps>,java.lang.constant.Constable,CharacterInfo
An enumeration representing small capital letters as a specialized form of characters.
Each constant in SmallCaps implements CharacterInfo and provides a corresponding
small capital character along with a default length used for display calculations. This enum also
provides utility methods for stripping accents from characters and converting strings to small caps
or back to their normal representations.
Example usage:
// Convert a normal string to small caps:
String smallCapsString = SmallCaps.toSmallCaps("Hello World");
// Check if a character is in small caps:
boolean isSmall = SmallCaps.isSmallCaps('ᴀ');
// Convert a small caps string back to normal:
String normalString = SmallCaps.toNormal(smallCapsString);
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionintReturns the bold length of this character.static booleanhasSmallCaps(String string) Checks if the provided string contains any small capital letters.static booleanisSmallCaps(char character) Checks if the provided character is represented as a small capital letter.static charstripAccent(char character) Removes accents from the given character.static StringstripAccents(String string) Removes accents from the provided string.static StringConverts a small capital string back to its normal form.static StringtoSmallCaps(String string) Converts the provided string to its small capital form.toString()Returns the small capital character as a string.static SmallCapsvalueOf(char character) Returns the correspondingSmallCapsconstant for the given character.static SmallCapsReturns the enum constant of this class with the specified name.static SmallCaps[]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
-
B
-
C
-
D
-
E
-
F
-
G
-
H
-
I
-
J
-
K
-
L
-
M
-
N
-
O
-
P
-
Q
-
R
-
S
-
T
-
U
-
V
-
W
-
X
-
Y
-
Z
-
-
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()Returns the bold length of this character.Bold length is calculated as the defined length plus one.
- Specified by:
getBoldLengthin interfaceCharacterInfo- Returns:
- the bold length.
-
toString
Returns the small capital character as a string. -
stripAccents
Removes accents from the provided string.- Parameters:
string- the string from which accents should be removed.- Returns:
- the string without any accents.
-
stripAccent
public static char stripAccent(char character) Removes accents from the given character.- Parameters:
character- the character to process.- Returns:
- the character without accent marks.
-
valueOf
Returns the correspondingSmallCapsconstant for the given character.Accents are stripped by default.
- Parameters:
character- the character to convert.- Returns:
- the corresponding
SmallCapsconstant, ornullif no match is found.
-
isSmallCaps
public static boolean isSmallCaps(char character) Checks if the provided character is represented as a small capital letter.- Parameters:
character- the character to check.- Returns:
trueif the character is a small capital;falseotherwise.
-
hasSmallCaps
Checks if the provided string contains any small capital letters.- Parameters:
string- the string to check.- Returns:
trueif the string contains at least one small capital letter;falseotherwise.
-
toSmallCaps
Converts the provided string to its small capital form.- Parameters:
string- the input string.- Returns:
- a new string where applicable characters are replaced with their small capital equivalents.
-
toNormal
Converts a small capital string back to its normal form.- Parameters:
string- the small capital string.- Returns:
- a new string where small capital characters are replaced by their default (normal) counterparts.
-