3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-05 14:55:45 +00:00
z3/src/api/java/StringSymbol.java
Christoph M. Wintersteiger 4304012971 Java API: copyright notices
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
2014-10-22 16:55:08 +01:00

54 lines
1.1 KiB
Java

/**
Copyright (c) 2012-2014 Microsoft Corporation
Module Name:
StringSymbol.java
Abstract:
Author:
@author Christoph Wintersteiger (cwinter) 2012-03-15
Notes:
**/
package com.microsoft.z3;
import com.microsoft.z3.enumerations.Z3_symbol_kind;
/**
* Named symbols
**/
public class StringSymbol extends Symbol
{
/**
* The string value of the symbol. <remarks>Throws an exception if the
* symbol is not of string kind.</remarks>
**/
public String getString() throws Z3Exception
{
return Native.getSymbolString(getContext().nCtx(), getNativeObject());
}
StringSymbol(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
StringSymbol(Context ctx, String s) throws Z3Exception
{
super(ctx, Native.mkStringSymbol(ctx.nCtx(), s));
}
void checkNativeObject(long obj) throws Z3Exception
{
if (Native.getSymbolKind(getContext().nCtx(), obj) != Z3_symbol_kind.Z3_STRING_SYMBOL
.toInt())
throw new Z3Exception("Symbol is not of String kind");
super.checkNativeObject(obj);
}
}