Record Class TranscriptElementLocation

java.lang.Object
java.lang.Record
ca.phon.session.position.TranscriptElementLocation
Record Components:
transcriptElementIndex - the index of the transcript element
tier - the tier name
charPosition - the character position within the tier content

public record TranscriptElementLocation(int transcriptElementIndex, String tier, int charPosition) extends Record
Represents a specific character location withing a transcript element. If the transcript element is a record, tier will be the name of the specific tier. If the transcript element is a comment, the tier name will be the type of comment, if the transcript element is a gem, tier will be the type of gem.
  • Constructor Details

    • TranscriptElementLocation

      public TranscriptElementLocation(int transcriptElementIndex, String tier, int charPosition)
      Creates an instance of a TranscriptElementLocation record class.
      Parameters:
      transcriptElementIndex - the value for the transcriptElementIndex record component
      tier - the value for the tier record component
      charPosition - the value for the charPosition record component
  • Method Details

    • valid

      public boolean valid()
    • compareTo

      public int compareTo(TranscriptElementLocation other)
    • compareTo

      public int compareTo(TranscriptElementLocation other, List<String> tierList)
    • 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.
    • transcriptElementIndex

      public int transcriptElementIndex()
      Returns the value of the transcriptElementIndex record component.
      Returns:
      the value of the transcriptElementIndex record component
    • tier

      public String tier()
      Returns the value of the tier record component.
      Returns:
      the value of the tier record component
    • charPosition

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