SetModEvent.java
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 package org.gecode;
00010
00046 public enum SetModEvent implements ModEvent {
00047 ME_SET_FAILED(-1),
00048 ME_SET_NONE(0),
00049 ME_SET_VAL(1),
00050 ME_SET_CARD(2),
00051 ME_SET_LUB(3),
00052 ME_SET_GLB(4),
00053 ME_SET_BB(5),
00054 ME_SET_CLUB(6),
00055 ME_SET_CGLB(7),
00056 ME_SET_CBB(8);
00057
00058 public final int swigValue() {
00059 return swigValue;
00060 }
00061
00062 public static SetModEvent swigToEnum(int swigValue) {
00063 SetModEvent[] swigValues = SetModEvent.class.getEnumConstants();
00064 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
00065 return swigValues[swigValue];
00066 for (SetModEvent swigEnum : swigValues)
00067 if (swigEnum.swigValue == swigValue)
00068 return swigEnum;
00069 throw new IllegalArgumentException("No enum " + SetModEvent.class + " with value " + swigValue);
00070 }
00071
00072 private SetModEvent() {
00073 this.swigValue = SwigNext.next++;
00074 }
00075
00076 private SetModEvent(int swigValue) {
00077 this.swigValue = swigValue;
00078 SwigNext.next = swigValue+1;
00079 }
00080
00081 private SetModEvent(SetModEvent swigEnum) {
00082 this.swigValue = swigEnum.swigValue;
00083 SwigNext.next = this.swigValue+1;
00084 }
00085
00086 private final int swigValue;
00087
00088 private static class SwigNext {
00089 private static int next = 0;
00090 }
00091
00092 public boolean failed() {
00093 return swigValue() == -1;
00094 }
00095 public boolean assigned() {
00096 return swigValue() == -1;
00097 }
00098 public GenModEvent toGeneric() {
00099 return GenModEvent.swigToEnum(Math.min(swigValue(), 2));
00100 }
00101 }
00102