All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.ortools.constraintsolver.CpModelLoader Maven / Gradle / Ivy

The newest version!
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.10
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.google.ortools.constraintsolver;

public class CpModelLoader {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected CpModelLoader(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(CpModelLoader obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        operations_research_constraint_solverJNI.delete_CpModelLoader(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CpModelLoader(Solver solver) {
    this(operations_research_constraint_solverJNI.new_CpModelLoader(Solver.getCPtr(solver), solver), true);
  }

  public Solver solver() {
    long cPtr = operations_research_constraint_solverJNI.CpModelLoader_solver(swigCPtr, this);
    return (cPtr == 0) ? null : new Solver(cPtr, false);
  }

  public IntExpr IntegerExpression(int index) {
    long cPtr = operations_research_constraint_solverJNI.CpModelLoader_IntegerExpression(swigCPtr, this, index);
    return (cPtr == 0) ? null : new IntExpr(cPtr, false);
  }

  public int NumIntegerExpressions() {
    return operations_research_constraint_solverJNI.CpModelLoader_NumIntegerExpressions(swigCPtr, this);
  }

  public IntervalVar IntervalVariable(int index) {
    long cPtr = operations_research_constraint_solverJNI.CpModelLoader_IntervalVariable(swigCPtr, this, index);
    return (cPtr == 0) ? null : new IntervalVar(cPtr, false);
  }

  public int NumIntervalVariables() {
    return operations_research_constraint_solverJNI.CpModelLoader_NumIntervalVariables(swigCPtr, this);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy