java.lang.Object
net.fellbaum.jemoji.internal.EmojiUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charstatic final char -
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddColonToAlias(String alias) static booleancheckIfCodepointIsInvalidEmojiStarter(int currentCodepoint) Checks if the codepoint is a valid starter character for anyEmojiType.findEmojiByEitherAlias(Map<CodepointSequence, List<Emoji>> map, String alias) static @Nullable NonUniqueEmojiFoundResultfindNonUniqueEmoji(int[] textCodePointsArray, int textIndex, long textCodePointsLength) Finds a unique emoji starting at the position textIndex in the textCodePointsArray.static @Nullable UniqueEmojiFoundResultfindUniqueEmoji(int[] textCodePointsArray, int textIndex, long textCodePointsLength, EmojiType type) Finds a unique emoji starting at the position textIndex in the textCodePointsArray.static intgetCodePointCount(String string) static booleanisStringNullOrEmpty(@Nullable String string) static StringremoveColonFromAlias(String alias) static int[]stringToCodePoints(String text)
-
Field Details
-
TEXT_VARIATION_CHARACTER
public static final char TEXT_VARIATION_CHARACTER- See Also:
-
EMOJI_VARIATION_CHARACTER
public static final char EMOJI_VARIATION_CHARACTER- See Also:
-
-
Method Details
-
getCodePointCount
-
isStringNullOrEmpty
-
removeColonFromAlias
-
addColonToAlias
-
findEmojiByEitherAlias
-
stringToCodePoints
-
findUniqueEmoji
public static @Nullable UniqueEmojiFoundResult findUniqueEmoji(int[] textCodePointsArray, int textIndex, long textCodePointsLength, EmojiType type) Finds a unique emoji starting at the position textIndex in the textCodePointsArray.- Parameters:
textCodePointsArray- The textCodePointsArray to check if it contains an emoji.textIndex- The current text index.textCodePointsLength- The length of the textCodePointsArray.type- TheEmojiTypeto check the codepoint against.- Returns:
- The found emoji, otherwise
null.
-
findNonUniqueEmoji
public static @Nullable NonUniqueEmojiFoundResult findNonUniqueEmoji(int[] textCodePointsArray, int textIndex, long textCodePointsLength) Finds a unique emoji starting at the position textIndex in the textCodePointsArray.- Parameters:
textCodePointsArray- The textCodePointsArray to check if it contains an emoji.textIndex- The current text index.textCodePointsLength- The length of the textCodePointsArray.- Returns:
- The found emoji, otherwise
null.
-
checkIfCodepointIsInvalidEmojiStarter
public static boolean checkIfCodepointIsInvalidEmojiStarter(int currentCodepoint) Checks if the codepoint is a valid starter character for anyEmojiType. This avoids running unnecessary for loops which take ~1ms longer.- Parameters:
currentCodepoint- The codepoint to check.- Returns:
- Whether the codepoint is a valid starter.
-