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