Record Class CodePoints.At

java.lang.Object
java.lang.Record
opennlp.tools.util.normalizer.CodePoints.At
Enclosing class:
CodePoints

static record CodePoints.At(int codePoint, int charCount) extends Record
A code point at an index together with its UTF-16 width.

The advance methods pair with the decode direction: an At read forward via CodePoints.at(CharSequence, int) advances with nextIndex(int) (taking the start index it was read at), and an At read backward via CodePoints.before(CharSequence, int) retreats with previousIndex(int) (taking the exclusive end index it was read at). Mixing an At with the other direction's method yields a wrong index.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The field for the charCount record component.
    private final int
    The field for the codePoint record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    At(int codePoint, int charCount)
    Creates an instance of a At record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the charCount record component.
    int
    Returns the value of the codePoint record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    (package private) int
    nextIndex(int index)
    Returns the index immediately after this code point.
    (package private) int
    previousIndex(int index)
    Returns the index immediately before this code point when read from the end.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • codePoint

      private final int codePoint
      The field for the codePoint record component.
    • charCount

      private final int charCount
      The field for the charCount record component.
  • Constructor Details

    • At

      At(int codePoint, int charCount)
      Creates an instance of a At record class.
      Parameters:
      codePoint - the value for the codePoint record component
      charCount - the value for the charCount record component
  • Method Details

    • nextIndex

      int nextIndex(int index)
      Returns the index immediately after this code point.
      Parameters:
      index - The start index this At was read at via CodePoints.at(CharSequence, int).
      Returns:
      the index immediately after this code point
    • previousIndex

      int previousIndex(int index)
      Returns the index immediately before this code point when read from the end.
      Parameters:
      index - The exclusive end index this At was read at via CodePoints.before(CharSequence, int).
      Returns:
      the index immediately before this code point when read from the end
    • 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. All components in this record class 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.
    • codePoint

      public int codePoint()
      Returns the value of the codePoint record component.
      Returns:
      the value of the codePoint record component
    • charCount

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