Z3
Z3_goal_prec.java
Go to the documentation of this file.
1 
5 package com.microsoft.z3.enumerations;
6 
7 import java.util.HashMap;
8 import java.util.Map;
9 
13 public enum Z3_goal_prec {
18 
19  private final int intValue;
20 
21  Z3_goal_prec(int v) {
22  this.intValue = v;
23  }
24 
25  // Cannot initialize map in constructor, so need to do it lazily.
26  // Easiest thread-safe way is the initialization-on-demand holder pattern.
27  private static class Z3_goal_prec_MappingHolder {
28  private static final Map<Integer, Z3_goal_prec> intMapping = new HashMap<>();
29  static {
30  for (Z3_goal_prec k : Z3_goal_prec.values())
31  intMapping.put(k.toInt(), k);
32  }
33  }
34 
35  public static final Z3_goal_prec fromInt(int v) {
36  Z3_goal_prec k = Z3_goal_prec_MappingHolder.intMapping.get(v);
37  if (k != null) return k;
38  throw new IllegalArgumentException("Illegal value " + v + " for Z3_goal_prec");
39  }
40 
41  public final int toInt() { return this.intValue; }
42 }
43 
static final Z3_goal_prec fromInt(int v)