All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.cvc5.modes.BlockModelsMode Maven / Gradle / Ivy

The newest version!
package io.github.cvc5.modes;

import io.github.cvc5.CVC5ApiException;
import java.util.HashMap;
import java.util.Map;

public enum BlockModelsMode
{
  /**
   * Block models based on the SAT skeleton.
   */
  LITERALS(0),
  /**
   * Block models based on the concrete model values for the free variables.
   */
  VALUES(1),
;

  /* the int value of the BlockModelsMode */
  private int value;
  private static int minValue = 0;
  private static int maxValue = 0;
  private static Map enumMap = new HashMap<>();

  private BlockModelsMode(int value)
  {
    this.value = value;
  }

  static
  {
    boolean firstValue = true;
    for (BlockModelsMode enumerator : BlockModelsMode.values())
    {
      int value = enumerator.getValue();
      if (firstValue)
      {
        minValue = value;
        maxValue = value;
        firstValue = false;
      }
      minValue = Math.min(minValue, value);
      maxValue = Math.max(maxValue, value);
      enumMap.put(value, enumerator);
    }
  }

  public static BlockModelsMode fromInt(int value) throws CVC5ApiException
  {
    if (value < minValue || value > maxValue)
    {
      throw new CVC5ApiException("BlockModelsMode value " + value + " is outside the valid range ["
          + minValue + "," + maxValue + "]");
    }
    return enumMap.get(value);
  }

  public int getValue()
  {
    return value;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy