Package io.github.cvc5
Class Stat
java.lang.Object
io.github.cvc5.Stat
Represents a snapshot of a single statistic value.
A value can be of type
long, double, String or a histogram
(Map<String, Long>).
The value type can be queried (using isInt(), isDouble(), etc.) and
the stored value can be accessed (using getInt(), getDouble(), etc.).
It is possible to query whether this statistic is an internal statistic by
isInternal() and whether its value is the default value by isDefault().-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidFree the native resource associated with this pointer.doubleReturn the double value.Return the histogram value.longgetInt()Return the integer value.longReturn the raw native pointer.Return the string value.booleanDoes this value hold the default value?booleanisDouble()Is this value a double?booleanIs this value a histogram?booleanisInt()Is this value an integer?booleanIs this value intended for internal use only?booleanisString()Is this value a string?toString()Return a string representation of the pointer.protected StringtoString(long pointer) Return a string representation of the specified native pointer.
-
Field Details
-
pointer
protected long pointerThe raw native pointer value.
-
-
Method Details
-
toString
Return a string representation of the specified native pointer.Subclasses must implement this method to convert the native pointer into a meaningful string.
- Parameters:
pointer- the native pointer- Returns:
- A string representation of this Stat.
-
isInternal
public boolean isInternal()Is this value intended for internal use only?- Returns:
- Whether this is an internal statistic.
-
isDefault
public boolean isDefault()Does this value hold the default value?- Returns:
- Whether this is a defaulted statistic.
-
isInt
public boolean isInt()Is this value an integer?- Returns:
- Whether the value is an integer.
-
getInt
public long getInt()Return the integer value.- Returns:
- The integer value.
-
isDouble
public boolean isDouble()Is this value a double?- Returns:
- Whether the value is a double.
-
getDouble
public double getDouble()Return the double value.- Returns:
- The double value.
-
isString
public boolean isString()Is this value a string?- Returns:
- Whether the value is a string.
-
getString
Return the string value.- Returns:
- The string value.
-
isHistogram
public boolean isHistogram()Is this value a histogram?- Returns:
- Whether the value is a histogram.
-
getHistogram
Return the histogram value.- Returns:
- The histogram value.
-
getPointer
public long getPointer()Return the raw native pointer.Every native call obtains the pointers of the objects it uses through this method, so that using an object after its native resource has been released raises an exception instead of crashing the JVM.
- Returns:
- the pointer value
- Throws:
IllegalStateException- if the native resource of this object has been released, e.g., viadeletePointer()
-
deletePointer
public void deletePointer()Free the native resource associated with this pointer.Native resources are freed automatically once the Java object is no longer reachable. This method frees the native resource immediately instead; afterwards, using the object raises an
IllegalStateException. It must be called from the thread that is using the associated term manager. Calling it more than once has no further effect. -
toString
Return a string representation of the pointer.
-