Record Class QueryEvaluationOutput

java.lang.Object
java.lang.Record
fr.inria.rules.integraal.component_builder.evaluators.query_evaluation.auxiliary.QueryEvaluationOutput
Record Components:
query - the evaluated query
answers - the iterator of answers, when materialized answers are available
result_size - the number of answers, when only the count is available
message - an optional preformatted message

public record QueryEvaluationOutput(Query query, Iterator<Substitution> answers, Long result_size, String message) extends Record
Stores the outcome of evaluating a query.
  • Constructor Details

    • QueryEvaluationOutput

      public QueryEvaluationOutput(Query query, Iterator<Substitution> answers, Long result_size, String message)
      Creates a query evaluation output and validates the provided payload.
  • Method Details

    • getPrintQueryAnswersCount

      public String getPrintQueryAnswersCount()
      Returns a printable summary containing the query and the answer count.
      Returns:
      the formatted query/count message
    • printOnlyAnswersCount

      public String printOnlyAnswersCount()
      Returns only the answer count portion of the output.
      Returns:
      the formatted count message
    • getPrintQueryAnswers

      public String getPrintQueryAnswers()
      Returns a printable summary containing the query and every answer.
      Returns:
      the formatted query/answers message
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • query

      public Query query()
      Returns the value of the query record component.
      Returns:
      the value of the query record component
    • answers

      public Iterator<Substitution> answers()
      Returns the value of the answers record component.
      Returns:
      the value of the answers record component
    • result_size

      public Long result_size()
      Returns the value of the result_size record component.
      Returns:
      the value of the result_size record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component