Record Class SymbolRange
java.lang.Object
java.lang.Record
com.github.curiousoddman.rgxgen.model.SymbolRange
Range of symbols
-
Constructor Summary
ConstructorsConstructorDescriptionSymbolRange(int from, int to) Creates an instance of aSymbolRangerecord class. -
Method Summary
Modifier and TypeMethodDescriptionchars()booleancontains(int c) booleanIndicates whether some other object is "equal to" this one.intfrom()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.static SymbolRangerange(char from, char to) Create inclusive range of symbols.static SymbolRangerange(int from, int to) Create inclusive range of symbols.intsize()intto()Returns the value of thetorecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
SymbolRange
public SymbolRange(int from, int to) Creates an instance of aSymbolRangerecord class.- Parameters:
from- the value for thefromrecord componentto- the value for thetorecord component
-
-
Method Details
-
range
Create inclusive range of symbols.- Parameters:
from- min character; shall be less thantoto- max character; shall be greater thanfrom- API Note:
- No verifications are done!
-
range
Create inclusive range of symbols.- Parameters:
from- min character; shall be less thantoto- max character; shall be greater thanfrom- API Note:
- No verifications are done!
-
size
public int size() -
chars
-
contains
public boolean contains(int c) -
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 '=='. -
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. -
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. -
from
public int from()Returns the value of thefromrecord component.- Returns:
- the value of the
fromrecord component
-
to
public int to()Returns the value of thetorecord component.- Returns:
- the value of the
torecord component
-