Generated on Fri Oct 6 16:26:44 2006 for Gecode/J by doxygen 1.4.7

IntVarView.java

Go to the documentation of this file.
00001 /* ----------------------------------------------------------------------------
00002  * This file was automatically generated by SWIG (http://www.swig.org).
00003  * Version 1.3.29
00004  *
00005  * Do not make changes to this file unless you know what you are doing--modify
00006  * the SWIG interface file instead.
00007  * ----------------------------------------------------------------------------- */
00008 
00009 package org.gecode;
00010 
00028 public class IntVarView implements IntView {
00029   private long swigCPtr;
00030   protected boolean swigCMemOwn;
00031 
00032   protected IntVarView(long cPtr, boolean cMemoryOwn) {
00033     swigCMemOwn = cMemoryOwn;
00034     swigCPtr = cPtr;
00035   }
00036 
00037   protected static long getCPtr(IntVarView obj) {
00038     return (obj == null) ? 0 : obj.swigCPtr;
00039   }
00040 
00041   protected void finalize() {
00042     delete();
00043   }
00044 
00045   public void delete() {
00046     if(swigCPtr != 0 && swigCMemOwn) {
00047       swigCMemOwn = false;
00048       GecodeJNI.delete_IntVarView(swigCPtr);
00049     }
00050     swigCPtr = 0;
00051   }
00052 
00053   public void subscribe(JavaSpace home, JavaPropagator p, PropCond pc) {
00054     if (!(pc instanceof IntPropCond)) 
00055       throw new IllegalArgumentException("PropCond argument not of type IntPropCond");
00056     subscribe_internal(home, p, pc.toInteger());
00057   }
00058   public void cancel(JavaSpace home, JavaPropagator p, PropCond pc) {
00059     if (!(pc instanceof IntPropCond)) 
00060       throw new IllegalArgumentException("PropCond argument not of type IntPropCond");
00061     cancel_internal(home, p, pc.toInteger());
00062   }
00063 
00064    public IntVarView(JavaSpace home, IntVar i) {
00067     this(GecodeJNI.new_IntVarView(JavaSpace.getCPtr(home), IntVar.getCPtr(i)), true);
00068   }
00069 
00070   public IntVarView copy(JavaSpace newHome, boolean share) {
00071     long cPtr = GecodeJNI.IntVarView_copy(swigCPtr, JavaSpace.getCPtr(newHome), share);
00072     return (cPtr == 0) ? null : new IntVarView(cPtr, true);
00073   }
00074 
00075   public void subscribe_internal(JavaSpace home, JavaPropagator p, int pc) {
00076     GecodeJNI.IntVarView_subscribe_internal(swigCPtr, JavaSpace.getCPtr(home), JavaPropagator.getCPtr(p), pc);
00077   }
00078 
00079   public void cancel_internal(JavaSpace home, JavaPropagator p, int pc) {
00080     GecodeJNI.IntVarView_cancel_internal(swigCPtr, JavaSpace.getCPtr(home), JavaPropagator.getCPtr(p), pc);
00081   }
00082 
00083   public int min() {
00084     return GecodeJNI.IntVarView_min(swigCPtr);
00085   }
00086 
00087   public int max() {
00088     return GecodeJNI.IntVarView_max(swigCPtr);
00089   }
00090 
00091   public int val() {
00092     return GecodeJNI.IntVarView_val(swigCPtr);
00093   }
00094 
00095   public boolean assigned() {
00096     return GecodeJNI.IntVarView_assigned(swigCPtr);
00097   }
00098 
00099   public boolean in(int arg0) {
00100     return GecodeJNI.IntVarView_in(swigCPtr, arg0);
00101   }
00102 
00103   public IntModEvent lq(JavaSpace home, int n) {
00104     return IntModEvent.swigToEnum(GecodeJNI.IntVarView_lq(swigCPtr, JavaSpace.getCPtr(home), n));
00105   }
00106 
00107   public IntModEvent gq(JavaSpace home, int n) {
00108     return IntModEvent.swigToEnum(GecodeJNI.IntVarView_gq(swigCPtr, JavaSpace.getCPtr(home), n));
00109   }
00110 
00111   public IntModEvent nq(JavaSpace home, int n) {
00112     return IntModEvent.swigToEnum(GecodeJNI.IntVarView_nq(swigCPtr, JavaSpace.getCPtr(home), n));
00113   }
00114 
00115   public IntModEvent eq(JavaSpace home, int n) {
00116     return IntModEvent.swigToEnum(GecodeJNI.IntVarView_eq(swigCPtr, JavaSpace.getCPtr(home), n));
00117   }
00118 
00119   public IntModEvent inter(JavaSpace home, RangeIterator iter) {
00120     return IntModEvent.swigToEnum(GecodeJNI.IntVarView_inter(swigCPtr, JavaSpace.getCPtr(home), new IntSet(iter.toRanges())));
00121   }
00122 
00123 }