/**
* This file was automatically generated from ASTVector.cs
**/
package com.Microsoft.Z3;
/* using System; */
/**
* Vectors of ASTs.
**/
class ASTVector extends Z3Object
{
/**
* The size of the vector
**/
public long Size() { return Native.astVectorSize(Context.nCtx, NativeObject); }
/**
* Retrieves the i-th object in the vector.
* May throw an IndexOutOfBoundsException when is out of range.
* Index
* @return An AST
**/
public AST get(long i)
{
return new AST(Context, Native.astVectorGet(Context.nCtx, NativeObject, i));
}
public void set(long i, AST value)
{
Native.astVectorSet(Context.nCtx, NativeObject, i, value.NativeObject);
}
/**
* Resize the vector to .
* The new size of the vector.
**/
public void Resize(long newSize)
{
Native.astVectorResize(Context.nCtx, NativeObject, newSize);
}
/**
* Add the AST to the back of the vector. The size
* is increased by 1.
* An AST
**/
public void Push(AST a)
{
Native.astVectorPush(Context.nCtx, NativeObject, a.NativeObject);
}
/**
* Translates all ASTs in the vector to .
* A context
* @return A new ASTVector
**/
public ASTVector Translate(Context ctx)
{
return new ASTVector(Context, Native.astVectorTranslate(Context.nCtx, NativeObject, ctx.nCtx));
}
/**
* Retrieves a string representation of the vector.
**/
public String toString()
{
return Native.astVectortoString(Context.nCtx, NativeObject);
}
ASTVector(Context ctx, IntPtr obj) { super(ctx, obj); }
ASTVector(Context ctx) { super(ctx, Native.mkAstVector(ctx.nCtx)); }
class DecRefQueue extends Z3.DecRefQueue
{
public void IncRef(Context ctx, IntPtr obj)
{
Native.astVectorIncRef(ctx.nCtx, obj);
}
public void DecRef(Context ctx, IntPtr obj)
{
Native.astVectorDecRef(ctx.nCtx, obj);
}
};
void IncRef(IntPtr o)
{
Context.ASTVector_DRQ.IncAndClear(Context, o);
super.IncRef(o);
}
void DecRef(IntPtr o)
{
Context.ASTVector_DRQ.Add(o);
super.DecRef(o);
}
}