Record Class Region
java.lang.Object
java.lang.Record
org.refcodes.data.Region
A text region has a beginning index being included by the region and an end
index being excluded by the region and a resulting length.
-
Constructor Summary
ConstructorsConstructorDescriptionRegion(int beginIndex, int endIndex) Creates an instance of aRegionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebeginIndexrecord component.intendIndex()Returns the value of theendIndexrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.inttoLength()Returns the length of the region as of(.endIndex()-beginIndex())final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Region
public Region(int beginIndex, int endIndex) Creates an instance of aRegionrecord class.- Parameters:
beginIndex- the value for thebeginIndexrecord componentendIndex- the value for theendIndexrecord component
-
-
Method Details
-
toLength
public int toLength()Returns the length of the region as of(.endIndex()-beginIndex())- Returns:
- The length of the region.
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
beginIndex
public int beginIndex()Returns the value of thebeginIndexrecord component.- Returns:
- the value of the
beginIndexrecord component
-
endIndex
public int endIndex()Returns the value of theendIndexrecord component.- Returns:
- the value of the
endIndexrecord component
-