java.lang.Object
java.lang.Record
org.maxicp.modeling.algebra.integer.IntervalLengthOrValue
- Record Components:
interval- the intervalvalue- the default value if the interval is absent
- All Implemented Interfaces:
Serializable,Expression,IntExpression,SymbolicIntExpression
public record IntervalLengthOrValue(IntervalVar interval, int value)
extends Record
implements SymbolicIntExpression
Gives the length an
IntervalVar or a given value if the interval is not present- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionIntervalLengthOrValue(IntervalVar interval, int value) Creates an instance of aIntervalLengthOrValuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends Expression> Should be implemented by all subclasses, but not used directly.booleandefaultContains(int v) intintdefaultFillArray(int[] array) intintintfinal booleanIndicates whether some other object is "equal to" this one.Returns the ModelDispatcher linked to this Expressionfinal inthashCode()Returns a hash code value for this object.interval()Returns the value of theintervalrecord component.booleanisFixed()True if the expression is fixedApply a function on all sub-expressions of this expression and returns a new expression of the same type.final StringtoString()Returns a string representation of this record class.intvalue()Returns the value of thevaluerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.maxicp.modeling.algebra.Expression
subexpressionsMethods inherited from interface org.maxicp.modeling.algebra.integer.IntExpression
show
-
Constructor Details
-
Method Details
-
defaultEvaluate
- Specified by:
defaultEvaluatein interfaceSymbolicIntExpression- Throws:
VariableNotFixedException
-
defaultMin
public int defaultMin()- Specified by:
defaultMinin interfaceSymbolicIntExpression
-
defaultMax
public int defaultMax()- Specified by:
defaultMaxin interfaceSymbolicIntExpression
-
defaultContains
public boolean defaultContains(int v) - Specified by:
defaultContainsin interfaceSymbolicIntExpression
-
defaultFillArray
public int defaultFillArray(int[] array) - Specified by:
defaultFillArrayin interfaceSymbolicIntExpression
-
defaultSize
public int defaultSize()- Specified by:
defaultSizein interfaceSymbolicIntExpression
-
computeSubexpressions
Description copied from interface:ExpressionShould be implemented by all subclasses, but not used directly. Use subexpressions() instead, which is a cached version of this. Returns a collection that contains all sub-expressions of this expression. It should not be modified. In practice, it should actually be unmutable or a copy.- Specified by:
computeSubexpressionsin interfaceExpression
-
mapSubexpressions
Description copied from interface:ExpressionApply a function on all sub-expressions of this expression and returns a new expression of the same type. This function should return a value that is of the same class as the object that was given to it.- Specified by:
mapSubexpressionsin interfaceExpression- Specified by:
mapSubexpressionsin interfaceIntExpression
-
isFixed
public boolean isFixed()Description copied from interface:ExpressionTrue if the expression is fixed- Specified by:
isFixedin interfaceExpression
-
getModelProxy
Description copied from interface:ExpressionReturns the ModelDispatcher linked to this Expression- Specified by:
getModelProxyin interfaceExpression
-
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 '=='. -
interval
Returns the value of theintervalrecord component.- Returns:
- the value of the
intervalrecord component
-
value
public int value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-