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

IntModEvent.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 enum IntModEvent implements ModEvent {
00029   ME_INT_FAILED(-1),
00030   ME_INT_NONE(0),
00031   ME_INT_VAL(1),
00032   ME_INT_BND(2),
00033   ME_INT_DOM(3);
00034 
00035   public final int swigValue() {
00036     return swigValue;
00037   }
00038 
00039   public static IntModEvent swigToEnum(int swigValue) {
00040     IntModEvent[] swigValues = IntModEvent.class.getEnumConstants();
00041     if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
00042       return swigValues[swigValue];
00043     for (IntModEvent swigEnum : swigValues)
00044       if (swigEnum.swigValue == swigValue)
00045         return swigEnum;
00046     throw new IllegalArgumentException("No enum " + IntModEvent.class + " with value " + swigValue);
00047   }
00048 
00049   private IntModEvent() {
00050     this.swigValue = SwigNext.next++;
00051   }
00052 
00053   private IntModEvent(int swigValue) {
00054     this.swigValue = swigValue;
00055     SwigNext.next = swigValue+1;
00056   }
00057 
00058   private IntModEvent(IntModEvent swigEnum) {
00059     this.swigValue = swigEnum.swigValue;
00060     SwigNext.next = this.swigValue+1;
00061   }
00062 
00063   private final int swigValue;
00064 
00065   private static class SwigNext {
00066     private static int next = 0;
00067   }
00068 
00069  public boolean failed() {
00070    return swigValue() == -1;
00071  }
00072  public boolean assigned() {
00073    return swigValue() ==  1;
00074  }
00075  public GenModEvent toGeneric() {
00076    return GenModEvent.swigToEnum(Math.min(swigValue(), 2));
00077  }
00078 }
00079