Module dev.civl.gmc
Package dev.civl.gmc

Class LogEntry

java.lang.Object
dev.civl.gmc.LogEntry
All Implemented Interfaces:
Comparable<LogEntry>

public abstract class LogEntry extends Object implements Comparable<LogEntry>
An entry in an error log. Each entry reports one error encountered during a model checking session. The application must extend this abstract class to a concrete class by implementing several methods.
  • Constructor Details

    • LogEntry

      public LogEntry(GMCConfiguration configuration)
      Default construtor: does nothing.
  • Method Details

    • printBody

      public abstract void printBody(PrintStream out)
      Prints an explanation of the error. Make this as precise as possible, showing relevant variable values, line numbers, and other source information.
      Parameters:
      out - the stream to which to print
    • compareTo

      public abstract int compareTo(LogEntry that)
      Compares this with another log entry in the natural order. The order should be defined so that higher priority errors come first. Should be compatible with equals.
      Specified by:
      compareTo in interface Comparable<LogEntry>
    • equals

      public abstract boolean equals(Object obj)
      Determines whether this log entry is equal to the given object. The given object must be a log entry. Two entries may be considered equal if they represent "essentially" the same error. For example, two violations of the same assertion may be considered equal. The exact choice depends on how many errors you want to report. The log will only record one error from each equivalence class under the equivalence relation defined by this equals method.
      Overrides:
      equals in class Object
    • getConfiguration

      public GMCConfiguration getConfiguration()
      Returns the configuration which will be used to replay the trace.
      Returns:
      the configuration
    • getId

      public int getId()
      Retunrs the ID number of this log entry, which should be unique within the log to which it belongs.
      Returns:
      the ID number of this log entry
    • getTraceFile

      public File getTraceFile()
      Returns the file to which the trace is saved.
      Returns:
      the file for the trace
    • getLength

      public int getLength()
      Returns the length of the trace.
      Returns:
      the length of the trace
    • print

      public void print(PrintStream out)
      Prints this log entry to the given stream.
      Parameters:
      out - stream to which to print