Class SimpleQueryRecordReporter

java.lang.Object
com.tangosol.util.SimpleQueryRecordReporter

public class SimpleQueryRecordReporter extends Object
Simple query record reporter used to obtain a string representation of QueryRecord object.
Since:
Coherence 3.7.1
Author:
tb 2011.05.26
  • Constructor Details

    • SimpleQueryRecordReporter

      public SimpleQueryRecordReporter()
  • Method Details

    • report

      public static String report(QueryRecord record)
      Return a report for the given query record.
      Parameters:
      record - the record
      Returns:
      a report for the given query record
    • reportResult

      protected static String reportResult(QueryRecord.PartialResult result, QueryRecorder.RecordType type, List<QueryRecord.PartialResult.IndexLookupRecord> listIndexLookups, boolean fReportPartition, List<String> listFooter)
      Report the given result.
      Parameters:
      result - the result
      type - the record type
      listIndexLookups - the list of lookup ids
      fReportPartition - indicates whether or not to report partitions
      listFooter - the list of full names which were truncated elsewhere in the report
      Returns:
      a report for the given result
    • reportIndexLookUps

      protected static String reportIndexLookUps(List<QueryRecord.PartialResult.IndexLookupRecord> listIndexLookups, List<String> listFooter)
      Report the index look ups.
      Parameters:
      listIndexLookups - the list of lookup ids
      listFooter - the list containing complete names which were truncated elsewhere in the report
      Returns:
      a report for the index look ups
    • reportFooter

      protected static String reportFooter(List<String> listFooter)
      Report the index look ups.
      Parameters:
      listFooter - the list of full names to be reported
      Returns:
      a footer portion of the report, where name that had to be truncated in the main portion, are printed in full
    • reportStep

      protected static String reportStep(QueryRecord.PartialResult.Step step, QueryRecorder.RecordType type, List<QueryRecord.PartialResult.IndexLookupRecord> listIndexLookups, int nLevel, List<String> listFooter)
      Report the given step.
      Parameters:
      step - the step
      type - the record type
      listIndexLookups - the list of lookup ids
      nLevel - the indent level
      listFooter - the list containing complete names, which had to be truncated in the main report
      Returns:
      a report line for the given step
    • checkTruncation

      protected static void checkTruncation(List<String> listFooter, StringBuilder sbName, int nColumnWidth)
      Check if the given name will be truncated in the table, and if yes, add the full name to the footer table.
      Parameters:
      listFooter - the list containing complete names
      sbName - the name to check
      nColumnWidth - the width of the table column, where the name must fit
    • reportIndexLookupRecord

      protected static String reportIndexLookupRecord(int nIndexLookupId, QueryRecord.PartialResult.IndexLookupRecord record, List<String> listFooter)
      Report the given index lookup record with the given id.
      Parameters:
      nIndexLookupId - the index lookup id
      record - the index lookup record
      listFooter - the list containing complete names, which had to be truncated
      Returns:
      a report line for the given index lookup
    • reportFooterItem

      protected static String reportFooterItem(int n, String sItem)
      Print the full name that corresponds to the given footer number.
      Parameters:
      n - the number used in the main report as a footer pointer
      sItem - the footer item to print
      Returns:
      a formatted entry in the footer table, containing the full name