Package de.firemage.autograder.treeg.ast
Record Class CharacterClass
java.lang.Object
java.lang.Record
de.firemage.autograder.treeg.ast.CharacterClass
- All Implemented Interfaces:
RegExNode
public record CharacterClass(boolean negated, List<CharacterClassEntry> ranges)
extends Record
implements RegExNode
-
Constructor Summary
ConstructorsConstructorDescriptionCharacterClass(boolean negated, List<CharacterClassEntry> ranges) Creates an instance of aCharacterClassrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleannegated()Returns the value of thenegatedrecord component.ranges()Returns the value of therangesrecord component.toRegEx()final StringtoString()Returns a string representation of this record class.voidtoTree(TreePrinter printer)
-
Constructor Details
-
CharacterClass
Creates an instance of aCharacterClassrecord class.- Parameters:
negated- the value for thenegatedrecord componentranges- the value for therangesrecord component
-
-
Method Details
-
toRegEx
-
toTree
-
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. -
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 '=='. -
negated
public boolean negated()Returns the value of thenegatedrecord component.- Returns:
- the value of the
negatedrecord component
-
ranges
Returns the value of therangesrecord component.- Returns:
- the value of the
rangesrecord component
-