Record Class SyllableInfo
java.lang.Object
java.lang.Record
ca.phon.ipa.SyllableInfo
- Record Components:
constituentType- syllable constituent typeisDiphthong- true if element is a diphthong member (only valid for SyllableConstituentType.NUCLEUS)stress- syllable stresssyllableIndex- index of syllable in word/phrase
public record SyllableInfo(SyllableConstituentType constituentType, boolean isDiphthong, SyllableStress stress, int syllableIndex, boolean segregated, int sonority, int sonorityDistance, ToneNumber tone)
extends Record
Syllable information for
IPAElements.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSyllableInfo(SyllableConstituentType constituentType, boolean isDiphthong, SyllableStress stress, int syllableIndex, boolean segregated, int sonority, int sonorityDistance, ToneNumber tone) Creates an instance of aSyllableInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<IPAElement> annotateElements(List<IPAElement> elems) Return a list of elements where the syllable info has been set.static SyllableInfo.Builderbuilder()Create a new builder instance with default values.Returns the value of theconstituentTyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisDiphthongrecord component.booleanReturns the value of thesegregatedrecord component.intsonority()Returns the value of thesonorityrecord component.intReturns the value of thesonorityDistancerecord component.stress()Returns the value of thestressrecord component.intReturns the value of thesyllableIndexrecord component.Create a builder initialized with the values from this SyllableInfo.tone()Returns the value of thetonerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SyllableInfo
public SyllableInfo(SyllableConstituentType constituentType, boolean isDiphthong, SyllableStress stress, int syllableIndex, boolean segregated, int sonority, int sonorityDistance, ToneNumber tone) Creates an instance of aSyllableInforecord class.- Parameters:
constituentType- the value for theconstituentTyperecord componentisDiphthong- the value for theisDiphthongrecord componentstress- the value for thestressrecord componentsyllableIndex- the value for thesyllableIndexrecord componentsegregated- the value for thesegregatedrecord componentsonority- the value for thesonorityrecord componentsonorityDistance- the value for thesonorityDistancerecord componenttone- the value for thetonerecord component
-
-
Method Details
-
builder
Create a new builder instance with default values.- Returns:
- builder
-
toBuilder
Create a builder initialized with the values from this SyllableInfo.- Returns:
- builder pre-populated with this record's values
-
annotateElements
Return a list of elements where the syllable info has been set. It's assumed that syllable constituent type information has been applied to the elements already.- Parameters:
elems- list of elements- Returns:
- list of elements with syllable info set - these elements have been cloned with new SyllableInfo information
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
constituentType
Returns the value of theconstituentTyperecord component.- Returns:
- the value of the
constituentTyperecord component
-
isDiphthong
public boolean isDiphthong()Returns the value of theisDiphthongrecord component.- Returns:
- the value of the
isDiphthongrecord component
-
stress
-
syllableIndex
public int syllableIndex()Returns the value of thesyllableIndexrecord component.- Returns:
- the value of the
syllableIndexrecord component
-
segregated
public boolean segregated()Returns the value of thesegregatedrecord component.- Returns:
- the value of the
segregatedrecord component
-
sonority
public int sonority()Returns the value of thesonorityrecord component.- Returns:
- the value of the
sonorityrecord component
-
sonorityDistance
public int sonorityDistance()Returns the value of thesonorityDistancerecord component.- Returns:
- the value of the
sonorityDistancerecord component
-
tone
Returns the value of thetonerecord component.- Returns:
- the value of the
tonerecord component
-