Record Class HunspellDictionary.WordBreak

java.lang.Object
java.lang.Record
opennlp.tools.stemmer.hunspell.HunspellDictionary.WordBreak
Record Components:
separator - The separator text without anchors. Never empty.
atStart - Whether the separator must begin the word.
atEnd - Whether the separator must end the word.
Enclosing class:
HunspellDictionary

static record HunspellDictionary.WordBreak(String separator, boolean atStart, boolean atEnd) extends Record
One BREAK declaration: a separator and the anchors that bind it to the start or end of the word.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final boolean
    The field for the atEnd record component.
    private final boolean
    The field for the atStart record component.
    private final String
    The field for the separator record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WordBreak(String separator, boolean atStart, boolean atEnd)
    Creates an instance of a WordBreak record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the atEnd record component.
    boolean
    Returns the value of the atStart 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) static HunspellDictionary.WordBreak
    parse(String declaration, int line)
    Parses a declaration such as -, ^-, or -$.
    Returns the value of the separator record component.
    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

    • separator

      private final String separator
      The field for the separator record component.
    • atStart

      private final boolean atStart
      The field for the atStart record component.
    • atEnd

      private final boolean atEnd
      The field for the atEnd record component.
  • Constructor Details

    • WordBreak

      WordBreak(String separator, boolean atStart, boolean atEnd)
      Creates an instance of a WordBreak record class.
      Parameters:
      separator - the value for the separator record component
      atStart - the value for the atStart record component
      atEnd - the value for the atEnd record component
  • Method Details

    • parse

      static HunspellDictionary.WordBreak parse(String declaration, int line) throws IOException
      Parses a declaration such as -, ^-, or -$.
      Parameters:
      declaration - The declared separator with optional anchors.
      line - The one-based source line, for diagnostics.
      Returns:
      The parsed declaration.
      Throws:
      IOException - Thrown if the declaration consists of anchors only.
    • 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.
    • separator

      public String separator()
      Returns the value of the separator record component.
      Returns:
      the value of the separator record component
    • atStart

      public boolean atStart()
      Returns the value of the atStart record component.
      Returns:
      the value of the atStart record component
    • atEnd

      public boolean atEnd()
      Returns the value of the atEnd record component.
      Returns:
      the value of the atEnd record component