FailStop.java
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 package org.gecode;
00010
00019 public class FailStop extends Stop {
00020 private long swigCPtr;
00021
00022 protected FailStop(long cPtr, boolean cMemoryOwn) {
00023 super(GecodeJNI.SWIGFailStopUpcast(cPtr), cMemoryOwn);
00024 swigCPtr = cPtr;
00025 }
00026
00027 protected static long getCPtr(FailStop obj) {
00028 return (obj == null) ? 0 : obj.swigCPtr;
00029 }
00030
00031 protected void finalize() {
00032 delete();
00033 }
00034
00035 public void delete() {
00036 if(swigCPtr != 0 && swigCMemOwn) {
00037 swigCMemOwn = false;
00038 GecodeJNI.delete_FailStop(swigCPtr);
00039 }
00040 swigCPtr = 0;
00041 super.delete();
00042 }
00043
00044 protected void swigDirectorDisconnect() {
00045 swigCMemOwn = false;
00046 delete();
00047 }
00048
00049 public void swigReleaseOwnership() {
00050 swigCMemOwn = false;
00051 GecodeJNI.FailStop_change_ownership(this, swigCPtr, false);
00052 }
00053
00054 public void swigTakeOwnership() {
00055 swigCMemOwn = true;
00056 GecodeJNI.FailStop_change_ownership(this, swigCPtr, true);
00057 }
00058 public FailStop(long l) {
00060 this(GecodeJNI.new_FailStop(l), true);
00061 GecodeJNI.FailStop_director_connect(this, swigCPtr, swigCMemOwn, true);
00062 }
00063 public long limit() {
00065 return GecodeJNI.FailStop_limit__SWIG_0(swigCPtr);
00066 }
00067 public void limit(long l) {
00069 GecodeJNI.FailStop_limit__SWIG_1(swigCPtr, l);
00070 }
00071 public boolean stop(Statistics s) {
00073 return GecodeJNI.FailStop_stop(swigCPtr, Statistics.getCPtr(s));
00074 }
00075
00076 }