18package com.microsoft.z3;
20import java.lang.ref.ReferenceQueue;
25class ASTMap
extends Z3Object {
33 public boolean contains(AST k)
36 return Native.astMapContains(getContext().nCtx(), getNativeObject(),
48 public AST find(AST k)
50 return new AST(getContext(), Native.astMapFind(getContext().nCtx(),
51 getNativeObject(), k.getNativeObject()));
59 public void insert(AST k, AST v)
62 Native.astMapInsert(getContext().nCtx(), getNativeObject(), k.getNativeObject(),
70 public void erase(AST k)
72 Native.astMapErase(getContext().nCtx(), getNativeObject(), k.getNativeObject());
80 Native.astMapReset(getContext().nCtx(), getNativeObject());
88 return Native.astMapSize(getContext().nCtx(), getNativeObject());
96 public AST[] getKeys()
98 ASTVector av =
new ASTVector(getContext(), Native.astMapKeys(getContext().nCtx(), getNativeObject()));
108 return Native.astMapToString(getContext().nCtx(), getNativeObject());
111 ASTMap(Context ctx,
long obj)
118 super(ctx, Native.mkAstMap(ctx.nCtx()));
123 Native.astMapIncRef(getContext().nCtx(), getNativeObject());
127 void addToReferenceQueue() {
128 getContext().getReferenceQueue().storeReference(
this, ASTMapRef::new);
131 private static class ASTMapRef
extends Z3ReferenceQueue.Reference<ASTMap> {
133 private ASTMapRef(ASTMap referent, ReferenceQueue<Z3Object> q) {
138 void decRef(Context ctx,
long z3Obj) {
139 Native.astMapDecRef(ctx.nCtx(), z3Obj);