Record Class EmojiEmoticons.Direction

java.lang.Object
java.lang.Record
opennlp.tools.util.normalizer.EmojiEmoticons.Direction
Record Components:
table - the candidate mappings keyed by first source code point.
minFirst - the smallest first code point of any source.
maxFirst - the largest first code point of any source.
Enclosing class:
EmojiEmoticons

static record EmojiEmoticons.Direction(Map<Integer,List<EmojiEmoticons.Mapping>> table, int minFirst, int maxFirst) extends Record
One direction table, keyed by the first code point of the source sequence, candidates ordered longest source first so a scan is longest-match. The first-code-point range bounds let the scan skip the map lookup for the common code point that no source starts with.
  • Field Details

  • Constructor Details

    • Direction

      Direction(Map<Integer,List<EmojiEmoticons.Mapping>> table, int minFirst, int maxFirst)
      Creates an instance of a Direction record class.
      Parameters:
      table - the value for the table record component
      minFirst - the value for the minFirst record component
      maxFirst - the value for the maxFirst record component
  • Method Details

    • candidates

      List<EmojiEmoticons.Mapping> candidates(int codePoint)
      Returns the candidate mappings whose source starts with codePoint, longest source first, or null if no source starts with it.
      Parameters:
      codePoint - the code point at the current scan position.
      Returns:
      the candidate mappings whose source starts with codePoint, longest source first, or null if no source starts with it
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • table

      Returns the value of the table record component.
      Returns:
      the value of the table record component
    • minFirst

      public int minFirst()
      Returns the value of the minFirst record component.
      Returns:
      the value of the minFirst record component
    • maxFirst

      public int maxFirst()
      Returns the value of the maxFirst record component.
      Returns:
      the value of the maxFirst record component