Record Class Constraints.ConstraintInfo
java.lang.Object
java.lang.Record
org.clafer.alloy.solve.Constraints.ConstraintInfo
- Enclosing class:
Constraints
public static record Constraints.ConstraintInfo(SourceSpan pos, String syntax, String position, int fileLine)
extends Record
A constraint of the model: its span in the complete model, its text,
and its position as shown, the file and the position in it
(
file.cfr:3:5), and the line in its file.-
Constructor Summary
ConstructorsConstructorDescriptionConstraintInfo(SourceSpan pos, String syntax, String position, int fileLine) Creates an instance of aConstraintInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intfileLine()Returns the value of thefileLinerecord component.final inthashCode()Returns a hash code value for this object.booleanisOnLine(long n) Whether the constraint spans the given line of its file.pos()Returns the value of theposrecord component.position()Returns the value of thepositionrecord component.syntax()Returns the value of thesyntaxrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
ConstraintInfo
Creates an instance of aConstraintInforecord class.- Parameters:
pos- the value for theposrecord componentsyntax- the value for thesyntaxrecord componentposition- the value for thepositionrecord componentfileLine- the value for thefileLinerecord component
-
-
Method Details
-
toString
-
isOnLine
Whether the constraint spans the given line of its file. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
pos
Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
syntax
-
position
-
fileLine
Returns the value of thefileLinerecord component.- Returns:
- the value of the
fileLinerecord component
-