Package com.vdurmont.emoji
Class EmojiTrie
- java.lang.Object
-
- com.vdurmont.emoji.EmojiTrie
-
public class EmojiTrie extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEmojiTrie.Matches
-
Constructor Summary
Constructors Constructor Description EmojiTrie(Collection<Emoji> emojis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable EmojigetEmoji(@NotNull String unicode)Finds Emoji instance from emoji unicode@NotNull EmojiTrie.MatchesisEmoji(char[] sequence)Checks if sequence of chars contain an emoji.@NotNull EmojiTrie.MatchesisEmoji(char[] sequence, int start, int end)Checks if the sequence of chars within the given bound indices contain an emoji.
-
-
-
Constructor Detail
-
EmojiTrie
public EmojiTrie(Collection<Emoji> emojis)
-
-
Method Detail
-
isEmoji
@NotNull public @NotNull EmojiTrie.Matches isEmoji(char[] sequence)
Checks if sequence of chars contain an emoji.- Parameters:
sequence- Sequence of char that may contain emoji in full or partially.- Returns:
EmojiTrie.Matches.EXACTLYif char sequence in its entirety is an emojiEmojiTrie.Matches.POSSIBLYif char sequence matches prefix of an emojiEmojiTrie.Matches.IMPOSSIBLEif char sequence matches no emoji or prefix of an emoji
-
isEmoji
@NotNull public @NotNull EmojiTrie.Matches isEmoji(char[] sequence, int start, int end)
Checks if the sequence of chars within the given bound indices contain an emoji.- Parameters:
sequence- Sequence of char that may contain emoji in full or partially.start- The starting indexend- The end index (exclusive)- Returns:
EmojiTrie.Matches.EXACTLYif char sequence in its entirety is an emojiEmojiTrie.Matches.POSSIBLYif char sequence matches prefix of an emojiEmojiTrie.Matches.IMPOSSIBLEif char sequence matches no emoji or prefix of an emoji
- Throws:
ArrayIndexOutOfBoundsException- If the provided range is invalid- See Also:
isEmoji(char[])
-
-