Record Class FindExpr

java.lang.Object
java.lang.Record
ca.phon.app.session.editor.search.FindExpr
Record Components:
type - the type of search to perform
expr - the expression to search for, must be valid for the given type
caseSensitive - whether or not the search should be case sensitive

public record FindExpr(SearchType type, String expr, boolean caseSensitive) extends Record
Find expression used for searching within a transcript.
  • Constructor Details

    • FindExpr

      public FindExpr(SearchType type, String expr, boolean caseSensitive)
      Creates an instance of a FindExpr record class.
      Parameters:
      type - the value for the type record component
      expr - the value for the expr record component
      caseSensitive - the value for the caseSensitive record component
  • Method Details

    • findNext

      public FindExprMatch findNext(Object obj, int charIdx)
      Find previous occurrence of the expression in the object.
      Parameters:
      obj - the object to search
      charIdx - the character index to start searching from
      Returns:
      the range for the next occurrence of the expression in the object, or an empty match if not found
    • findPrev

      public FindExprMatch findPrev(Object obj, int charIdx)
      Find previous occurrence of the expression in the object.
      Parameters:
      obj - the object to search
      charIdx - the character index to start searching from
      Returns:
      the range for the previous occurrence of the expression in the object, or null if not found
    • findNextPlain

      public FindExprMatch findNextPlain(String txt, int charIdx)
    • findPrevPlain

      public FindExprMatch findPrevPlain(String txt, int charIdx)
    • findNextRegex

      public FindExprMatch findNextRegex(String txt, int charIdx)
    • findPrevRegex

      public FindExprMatch findPrevRegex(String txt, int charIdx)
    • findNextPhonex

      public FindExprMatch findNextPhonex(IPATranscript ipa, int charIdx)
    • findPrevPhonex

      public FindExprMatch findPrevPhonex(IPATranscript ipa, int charIdx)
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • type

      public SearchType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • expr

      public String expr()
      Returns the value of the expr record component.
      Returns:
      the value of the expr record component
    • caseSensitive

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