Class Statistics

java.lang.Object
io.github.cvc5.Statistics
All Implemented Interfaces:
Iterable<Map.Entry<String,Stat>>

public class Statistics extends Object implements Iterable<Map.Entry<String,Stat>>
Represents a snapshot of the solver statistics.
  • Field Details

    • pointer

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

    • 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 Statistics.
    • get

      public Stat get(String name)
      Retrieve the statistic with the given name. Asserts that a statistic with the given name actually exists and throws a CVC5ApiRecoverableException if it does not.
      Parameters:
      name - Name of the statistic.
      Returns:
      The statistic with the given name.
    • iterator

      public Statistics.ConstIterator iterator(boolean internal, boolean defaulted)
      Begin iteration over the statistics values. By default, only entries that are public (non-internal) and have been set are visible while the others are skipped.
      Parameters:
      internal - If set to true, internal statistics are shown as well.
      defaulted - If set to true, defaulted statistics are shown as well.
      Returns:
      A ConstIterator over the matching statistics entries.
    • iterator

      public Statistics.ConstIterator iterator()
      Specified by:
      iterator in interface Iterable<Map.Entry<String,Stat>>
    • 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., via deletePointer()
    • 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

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