Class Stat

java.lang.Object
io.github.cvc5.Stat

public class Stat extends Object
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
    Modifier and Type
    Field
    Description
    protected long
    The raw native pointer value.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Free the native resource associated with this pointer.
    protected void
    deletePointer(long pointer)
    Delete the native resource associated with the specified pointer.
    double
    Return the double value.
    Return the histogram value.
    long
    Return the integer value.
    long
    Return the raw native pointer.
    Return the string value.
    boolean
    Does this value hold the default value?
    boolean
    Is this value a double?
    boolean
    Is this value a histogram?
    boolean
    Is this value an integer?
    boolean
    Is this value intended for internal use only?
    boolean
    Is this value a string?
    Return a string representation of the pointer.
    protected String
    toString(long pointer)
    Return a string representation of the specified native pointer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • pointer

      protected long pointer
      The raw native pointer value.
  • Method Details

    • deletePointer

      protected void deletePointer(long pointer)
      Delete the native resource associated with the specified pointer.

      Subclasses must implement this method to provide resource-specific cleanup logic.

      Parameters:
      pointer - the native pointer to delete
    • toString

      protected String toString(long pointer)
      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

      public 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

      public Map<String,Long> getHistogram()
      Return the histogram value.
      Returns:
      The histogram value.
    • getPointer

      public long getPointer()
      Return the raw native pointer.
      Returns:
      the pointer value
    • deletePointer

      public void deletePointer()
      Free the native resource associated with this pointer.

      This method should be called to explicitly clean up the underlying native resource. It removes this instance from the Context, then invokes the subclass-defined deletePointer(long) method to perform the actual cleanup.

    • toString

      public String toString()
      Return a string representation of the pointer.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the pointer