java.lang.Object
java.lang.Record
org.maxicp.modeling.constraints.seqvar.Precedence
- Record Components:
seqVar- the sequence variablenodes- the nodes that must respect the given relative ordering
- All Implemented Interfaces:
Constraint,org.maxicp.modeling.constraints.helpers.CacheScope,org.maxicp.modeling.constraints.helpers.ConstraintFromRecord
public record Precedence(SeqVar seqVar, int[] nodes)
extends Record
implements org.maxicp.modeling.constraints.helpers.ConstraintFromRecord
Precedence constraint on a sequence variable (
SeqVar), ensuring that the given nodes
appear in the specified relative order if visited in the sequence.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.maxicp.modeling.constraints.helpers.ConstraintFromRecord
org.maxicp.modeling.constraints.helpers.ConstraintFromRecord.IgnoreScope -
Constructor Summary
ConstructorsConstructorDescriptionPrecedence(SeqVar seqVar, int... nodes) Creates an instance of aPrecedencerecord 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.int[]nodes()Returns the value of thenodesrecord component.seqVar()Returns the value of theseqVarrecord component.final StringtoString()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 org.maxicp.modeling.constraints.helpers.CacheScope
scopeMethods inherited from interface org.maxicp.modeling.constraints.helpers.ConstraintFromRecord
computeScope
-
Constructor Details
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
seqVar
Returns the value of theseqVarrecord component.- Returns:
- the value of the
seqVarrecord component
-
nodes
public int[] nodes()Returns the value of thenodesrecord component.- Returns:
- the value of the
nodesrecord component
-