SetVar.java
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 package org.gecode;
00010
00017 public class SetVar implements GecodeVar {
00018 private long swigCPtr;
00019 protected boolean swigCMemOwn;
00020
00021 protected SetVar(long cPtr, boolean cMemoryOwn) {
00022 swigCMemOwn = cMemoryOwn;
00023 swigCPtr = cPtr;
00024 }
00025
00026 protected static long getCPtr(SetVar obj) {
00027 return (obj == null) ? 0 : obj.swigCPtr;
00028 }
00029
00030 protected void finalize() {
00031 delete();
00032 }
00033
00034 public void delete() {
00035 if(swigCPtr != 0 && swigCMemOwn) {
00036 swigCMemOwn = false;
00037 GecodeJNI.delete_SetVar(swigCPtr);
00038 }
00039 swigCPtr = 0;
00040 }
00041
00042 protected static long[] cArrayUnwrap(VarArray<? extends SetVar> arrayWrapper) {
00043 long[] cArray = new long[arrayWrapper.size()];
00044 for (int i=0; i<arrayWrapper.size(); i++)
00045 cArray[i] = SetVar.getCPtr(arrayWrapper.get(i));
00046 return cArray;
00047 }
00048
00049 protected static VarArray<SetVar> cArrayWrap(long[] cArray,
00050 boolean cMemoryOwn) {
00051 VarArray<SetVar> arrayWrapper = new VarArray<SetVar>(cArray.length);
00052 for (int i=0; i<cArray.length; i++)
00053 arrayWrapper.add(i, new SetVar(cArray[i], cMemoryOwn));
00054 return arrayWrapper;
00055 }
00056
00057 public SetVar(JavaSpace home, IntSet glb, IntSet lub) {
00060 this(GecodeJNI.new_SetVar__SWIG_0(JavaSpace.getCPtr(home), IntSet.getCPtr(glb), IntSet.getCPtr(lub)), true);
00061 }
00062
00063 public SetVar(JavaSpace home, String name, IntSet glb, IntSet lub) {
00066 this(GecodeJNI.new_SetVar__SWIG_1(JavaSpace.getCPtr(home), name, IntSet.getCPtr(glb), IntSet.getCPtr(lub)), true);
00067 }
00068
00069 public SetVar(JavaSpace home) {
00072 this(GecodeJNI.new_SetVar__SWIG_2(JavaSpace.getCPtr(home)), true);
00073 }
00074
00075 public SetVar(JavaSpace home, String name) {
00078 this(GecodeJNI.new_SetVar__SWIG_3(JavaSpace.getCPtr(home), name), true);
00079 }
00080
00081 public synchronized SetVar copy(JavaSpace newHome, boolean share) {
00084 return new SetVar(GecodeJNI.SetVar_copy(swigCPtr, JavaSpace.getCPtr(newHome), share), true);
00085 }
00086
00087 public synchronized String toString() {
00090 return GecodeJNI.SetVar_toString(swigCPtr);
00091 }
00092
00093 public synchronized String getName() {
00096 return GecodeJNI.SetVar_getName(swigCPtr);
00097 }
00098
00099 public synchronized boolean assigned() {
00102 return GecodeJNI.SetVar_assigned(swigCPtr);
00103 }
00104
00105 public synchronized int glbSize() {
00108 return GecodeJNI.SetVar_glbSize(swigCPtr);
00109 }
00110
00111 public synchronized int lubSize() {
00114 return GecodeJNI.SetVar_lubSize(swigCPtr);
00115 }
00116
00117 public synchronized int unknownSize() {
00120 return GecodeJNI.SetVar_unknownSize(swigCPtr);
00121 }
00122
00123 public synchronized boolean contains(int i) {
00126 return GecodeJNI.SetVar_contains(swigCPtr, i);
00127 }
00128
00129 public synchronized boolean notContains(int i) {
00132 return GecodeJNI.SetVar_notContains(swigCPtr, i);
00133 }
00134
00135 public synchronized int cardMin() {
00138 return GecodeJNI.SetVar_cardMin(swigCPtr);
00139 }
00140
00141 public synchronized int cardMax() {
00144 return GecodeJNI.SetVar_cardMax(swigCPtr);
00145 }
00146
00147 public synchronized int lubMin() {
00150 return GecodeJNI.SetVar_lubMin(swigCPtr);
00151 }
00152
00153 public synchronized int lubMax() {
00156 return GecodeJNI.SetVar_lubMax(swigCPtr);
00157 }
00158
00159 public synchronized int glbMin() {
00162 return GecodeJNI.SetVar_glbMin(swigCPtr);
00163 }
00164
00165 public synchronized int glbMax() {
00168 return GecodeJNI.SetVar_glbMax(swigCPtr);
00169 }
00170
00171 }