Z3
ASTVector.java
Go to the documentation of this file.
1 
18 package com.microsoft.z3;
19 
23 public class ASTVector extends Z3Object
24 {
28  public int size()
29  {
30  return Native.astVectorSize(getContext().nCtx(), getNativeObject());
31  }
32 
42  public AST get(int i)
43  {
44  return new AST(getContext(), Native.astVectorGet(getContext().nCtx(),
45  getNativeObject(), i));
46  }
47 
48  public void set(int i, AST value)
49  {
50 
51  Native.astVectorSet(getContext().nCtx(), getNativeObject(), i,
52  value.getNativeObject());
53  }
54 
59  public void resize(int newSize)
60  {
61  Native.astVectorResize(getContext().nCtx(), getNativeObject(), newSize);
62  }
63 
69  public void push(AST a)
70  {
71  Native.astVectorPush(getContext().nCtx(), getNativeObject(), a.getNativeObject());
72  }
73 
82  {
83  return new ASTVector(getContext(), Native.astVectorTranslate(getContext()
84  .nCtx(), getNativeObject(), ctx.nCtx()));
85  }
86 
90  public String toString()
91  {
92  try
93  {
94  return Native.astVectorToString(getContext().nCtx(), getNativeObject());
95  } catch (Z3Exception e)
96  {
97  return "Z3Exception: " + e.getMessage();
98  }
99  }
100 
101  ASTVector(Context ctx, long obj)
102  {
103  super(ctx, obj);
104  }
105 
106  ASTVector(Context ctx)
107  {
108  super(ctx, Native.mkAstVector(ctx.nCtx()));
109  }
110 
111  void incRef(long o)
112  {
113  getContext().getASTVectorDRQ().incAndClear(getContext(), o);
114  super.incRef(o);
115  }
116 
117  void decRef(long o)
118  {
119  getContext().getASTVectorDRQ().add(o);
120  super.decRef(o);
121  }
122 }
void set(int i, AST value)
Definition: ASTVector.java:48
static String astVectorToString(long a0, long a1)
Definition: Native.java:3583
static long astVectorTranslate(long a0, long a1, long a2)
Definition: Native.java:3574
static int astVectorSize(long a0, long a1)
Definition: Native.java:3532
IDecRefQueue getASTVectorDRQ()
Definition: Context.java:3675
void incAndClear(Context ctx, long o)
ASTVector translate(Context ctx)
Definition: ASTVector.java:81
static void astVectorSet(long a0, long a1, int a2, long a3)
Definition: Native.java:3550
static long astVectorGet(long a0, long a1, int a2)
Definition: Native.java:3541
void resize(int newSize)
Definition: ASTVector.java:59
static void astVectorPush(long a0, long a1, long a2)
Definition: Native.java:3566
static void astVectorResize(long a0, long a1, int a2)
Definition: Native.java:3558