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