Z3
ASTMap.java
Go to the documentation of this file.
1 
18 package com.microsoft.z3;
19 
23 class ASTMap extends Z3Object
24 {
32  public boolean contains(AST k)
33  {
34 
35  return Native.astMapContains(getContext().nCtx(), getNativeObject(),
36  k.getNativeObject());
37  }
38 
47  public AST find(AST k)
48  {
49  return new AST(getContext(), Native.astMapFind(getContext().nCtx(),
50  getNativeObject(), k.getNativeObject()));
51  }
52 
58  public void insert(AST k, AST v)
59  {
60 
61  Native.astMapInsert(getContext().nCtx(), getNativeObject(), k.getNativeObject(),
62  v.getNativeObject());
63  }
64 
69  public void erase(AST k)
70  {
71  Native.astMapErase(getContext().nCtx(), getNativeObject(), k.getNativeObject());
72  }
73 
77  public void reset()
78  {
79  Native.astMapReset(getContext().nCtx(), getNativeObject());
80  }
81 
85  public int size()
86  {
87  return Native.astMapSize(getContext().nCtx(), getNativeObject());
88  }
89 
95  public AST[] getKeys()
96  {
97  ASTVector av = new ASTVector(getContext(), Native.astMapKeys(getContext().nCtx(), getNativeObject()));
98  return av.ToArray();
99  }
100 
104  public String toString()
105  {
106  try
107  {
108  return Native.astMapToString(getContext().nCtx(), getNativeObject());
109  } catch (Z3Exception e)
110  {
111  return "Z3Exception: " + e.getMessage();
112  }
113  }
114 
115  ASTMap(Context ctx, long obj)
116  {
117  super(ctx, obj);
118  }
119 
120  ASTMap(Context ctx)
121  {
122  super(ctx, Native.mkAstMap(ctx.nCtx()));
123  }
124 
125  void incRef(long o)
126  {
127  getContext().getASTMapDRQ().incAndClear(getContext(), o);
128  super.incRef(o);
129  }
130 
131  void decRef(long o)
132  {
133  getContext().getASTMapDRQ().add(o);
134  super.decRef(o);
135  }
136 }
void incAndClear(Context ctx, long o)
IDecRefQueue getASTMapDRQ()
Definition: Context.java:3689