Z3
Z3_sort_kind.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_sort_kind {
26  Z3_RE_SORT (12),
28 
29  private final int intValue;
30 
31  Z3_sort_kind(int v) {
32  this.intValue = v;
33  }
34 
35  // Cannot initialize map in constructor, so need to do it lazily.
36  // Easiest thread-safe way is the initialization-on-demand holder pattern.
37  private static class Z3_sort_kind_MappingHolder {
38  private static final Map<Integer, Z3_sort_kind> intMapping = new HashMap<>();
39  static {
40  for (Z3_sort_kind k : Z3_sort_kind.values())
41  intMapping.put(k.toInt(), k);
42  }
43  }
44 
45  public static final Z3_sort_kind fromInt(int v) {
46  Z3_sort_kind k = Z3_sort_kind_MappingHolder.intMapping.get(v);
47  if (k != null) return k;
48  throw new IllegalArgumentException("Illegal value " + v + " for Z3_sort_kind");
49  }
50 
51  public final int toInt() { return this.intValue; }
52 }
53 
static final Z3_sort_kind fromInt(int v)