Record Class FunctionSummary.RequirePredicate
java.lang.Object
java.lang.Record
org.ek9lang.compiler.symbolic.FunctionSummary.RequirePredicate
- Record Components:
paramIndex- the 0-based position of the constrained parameter in the callee's signatureparamName- the parameter's name (for readability / caller-side matching)op- the normalised relational operator (<,<=,>,>=,==,<>)literal- the integer literal the parameter is compared against
- Enclosing class:
FunctionSummary
-
Constructor Summary
ConstructorsConstructorDescriptionRequirePredicate(int paramIndex, String paramName, String op, long literal) Creates an instance of aRequirePredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanWhether this precondition guarantees the parameter is non-zero — so a division by that parameter, dominated by thisrequire, is discharged (cannot divide by zero).final inthashCode()Returns a hash code value for this object.longliteral()Returns the value of theliteralrecord component.op()Returns the value of theoprecord component.intReturns the value of theparamIndexrecord component.Returns the value of theparamNamerecord component.final StringtoString()Returns a string representation of this record class.longThe argument value that violates this precondition — the boundary at (or just past) the literal, depending on the operator.
-
Constructor Details
-
RequirePredicate
Creates an instance of aRequirePredicaterecord class.- Parameters:
paramIndex- the value for theparamIndexrecord componentparamName- the value for theparamNamerecord componentop- the value for theoprecord componentliteral- the value for theliteralrecord component
-
-
Method Details
-
excludesZero
public boolean excludesZero()Whether this precondition guarantees the parameter is non-zero — so a division by that parameter, dominated by thisrequire, is discharged (cannot divide by zero). -
violatingArgValue
public long violatingArgValue()The argument value that violates this precondition — the boundary at (or just past) the literal, depending on the operator. Feeding this back through a caller's argument transform yields the caller input that panics. E.g.require x <> 0is violated byx = 0. -
toString
-
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. -
paramIndex
public int paramIndex()Returns the value of theparamIndexrecord component.- Returns:
- the value of the
paramIndexrecord component
-
paramName
-
op
-
literal
-