Package com.google.ortools.sat
Class IntVar
- java.lang.Object
-
- com.google.ortools.sat.IntVar
-
- All Implemented Interfaces:
LinearArgument
- Direct Known Subclasses:
BoolVar
public class IntVar extends java.lang.Object implements LinearArgument
An integer variable.
-
-
Field Summary
Fields Modifier and Type Field Description protected CpModelProto.BuildermodelBuilderprotected IntegerVariableProto.BuildervarBuilderprotected intvariableIndex
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinearExprbuild()Builds a linear expression.java.lang.StringdisplayBounds()Returns the domain as a string without the enclosing [].IntegerVariableProto.BuildergetBuilder()Returns the variable protobuf builder.DomaingetDomain()Returns the domain of the variable.intgetIndex()Returns the index of the variable in the underlying CpModelProto.java.lang.StringgetName()Returns the name of the variable given upon creation.java.lang.StringtoString()
-
-
-
Field Detail
-
modelBuilder
protected final CpModelProto.Builder modelBuilder
-
variableIndex
protected final int variableIndex
-
varBuilder
protected final IntegerVariableProto.Builder varBuilder
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the variable given upon creation.
-
getIndex
public int getIndex()
Returns the index of the variable in the underlying CpModelProto.
-
getBuilder
public IntegerVariableProto.Builder getBuilder()
Returns the variable protobuf builder.
-
build
public LinearExpr build()
Description copied from interface:LinearArgumentBuilds a linear expression.- Specified by:
buildin interfaceLinearArgument
-
displayBounds
public java.lang.String displayBounds()
Returns the domain as a string without the enclosing [].
-
getDomain
public Domain getDomain()
Returns the domain of the variable.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-