Record Class Range
java.lang.Object
java.lang.Record
org.applecommander.util.Range
Represents a range of numbers with helper methods to put them together.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intfirst()Returns the value of thefirstrecord component.final inthashCode()Returns a hash code value for this object.intlast()Returns the value of thelastrecord component.intsize()stream()toString()Returns a string representation of this record class.
-
Constructor Details
-
Range
public Range(int first, int last) Creates an instance of aRangerecord class.- Parameters:
first- the value for thefirstrecord componentlast- the value for thelastrecord component
-
-
Method Details
-
size
public int size() -
stream
-
toString
-
from
-
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. -
first
public int first()Returns the value of thefirstrecord component.- Returns:
- the value of the
firstrecord component
-
last
public int last()Returns the value of thelastrecord component.- Returns:
- the value of the
lastrecord component
-