3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 13:28:47 +00:00
z3/src/api/java/ParamDescrs.java
George Karpenkov 1dcaddbec7 Adding @Override declarations
They are important, as they prevent miss-spelling the parent method  and
/or arguments name.
2016-01-06 11:07:48 +01:00

106 lines
2.1 KiB
Java

/**
Copyright (c) 2012-2014 Microsoft Corporation
Module Name:
ParamDescrs.java
Abstract:
Author:
@author Christoph Wintersteiger (cwinter) 2012-03-15
Notes:
**/
package com.microsoft.z3;
import com.microsoft.z3.enumerations.Z3_param_kind;
/**
* A ParamDescrs describes a set of parameters.
**/
public class ParamDescrs extends Z3Object
{
/**
* validate a set of parameters.
**/
public void validate(Params p)
{
Native.paramsValidate(getContext().nCtx(), p.getNativeObject(),
getNativeObject());
}
/**
* Retrieve kind of parameter.
**/
public Z3_param_kind getKind(Symbol name)
{
return Z3_param_kind.fromInt(Native.paramDescrsGetKind(
getContext().nCtx(), getNativeObject(), name.getNativeObject()));
}
/**
* Retrieve all names of parameters.
*
* @throws Z3Exception
**/
public Symbol[] getNames()
{
int sz = Native.paramDescrsSize(getContext().nCtx(), getNativeObject());
Symbol[] names = new Symbol[sz];
for (int i = 0; i < sz; ++i)
{
names[i] = Symbol.create(getContext(), Native.paramDescrsGetName(
getContext().nCtx(), getNativeObject(), i));
}
return names;
}
/**
* The size of the ParamDescrs.
**/
public int size()
{
return Native.paramDescrsSize(getContext().nCtx(), getNativeObject());
}
/**
* Retrieves a string representation of the ParamDescrs.
**/
@Override
public String toString()
{
try
{
return Native.paramDescrsToString(getContext().nCtx(), getNativeObject());
} catch (Z3Exception e)
{
return "Z3Exception: " + e.getMessage();
}
}
ParamDescrs(Context ctx, long obj)
{
super(ctx, obj);
}
@Override
void incRef(long o)
{
getContext().getParamDescrsDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
@Override
void decRef(long o)
{
getContext().getParamDescrsDRQ().add(o);
super.decRef(o);
}
}