Package com.github.tonivade.purefun.data
Record Class Range
java.lang.Object
java.lang.Record
com.github.tonivade.purefun.data.Range
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbegin()Returns the value of thebeginrecord component.collect()booleancontains(int value) intend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theincrementrecord component.iterator()<T> ImmutableArray<T> static Rangeof(int begin, int end) static Rangeof(int begin, int end, int increment) reverse()intsize()stream()toString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
begin
private final int beginThe field for thebeginrecord component. -
end
private final int endThe field for theendrecord component. -
increment
private final int incrementThe field for theincrementrecord component.
-
-
Constructor Details
-
Range
public Range(int begin, int end) -
Range
public Range(int begin, int end, int increment) Creates an instance of aRangerecord class.- Parameters:
begin- the value for thebeginrecord componentend- the value for theendrecord componentincrement- the value for theincrementrecord component
-
-
Method Details
-
reverse
-
contains
public boolean contains(int value) -
size
public int size() -
collect
-
map
-
intStream
-
stream
-
iterator
-
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. -
of
-
of
-
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. -
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 '=='. -
begin
public int begin()Returns the value of thebeginrecord component.- Returns:
- the value of the
beginrecord component
-
end
public int end()Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
increment
public int increment()Returns the value of theincrementrecord component.- Returns:
- the value of the
incrementrecord component
-