Package opennlp.tools.util.normalizer
Record Class CodePoints.At
java.lang.Object
java.lang.Record
opennlp.tools.util.normalizer.CodePoints.At
- Enclosing class:
CodePoints
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecharCountrecord component.intReturns the value of thecodePointrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.(package private) intnextIndex(int index) Returns the index immediately after this code point.(package private) intpreviousIndex(int index) Returns the index immediately before this code point when read from the end.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
codePoint
private final int codePointThe field for thecodePointrecord component. -
charCount
private final int charCountThe field for thecharCountrecord component.
-
-
Constructor Details
-
At
At(int codePoint, int charCount) Creates an instance of aAtrecord class.- Parameters:
codePoint- the value for thecodePointrecord componentcharCount- the value for thecharCountrecord component
-
-
Method Details
-
nextIndex
int nextIndex(int index) Returns the index immediately after this code point.- Parameters:
index- The start index thisAtwas read at viaCodePoints.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 thisAtwas read at viaCodePoints.before(CharSequence, int).- Returns:
- the index immediately before this code point when read from the end
-
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. -
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. -
equals
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 '=='. -
codePoint
public int codePoint()Returns the value of thecodePointrecord component.- Returns:
- the value of the
codePointrecord component
-
charCount
public int charCount()Returns the value of thecharCountrecord component.- Returns:
- the value of the
charCountrecord component
-