Class BestQueryLogger


  • public class BestQueryLogger
    extends BestQuery
    Logs each query added.
    Author:
    Matthew Wakeling
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String bestQueryString  
      protected boolean full  
    • Constructor Summary

      Constructors 
      Constructor Description
      BestQueryLogger​(boolean full)
      Constructs a BestQueryLogger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.String q)
      Allows a Query to be added to this tracker.
      void add​(Query q)
      Allows a Query to be added to this tracker.
      Query getBestQuery()
      Gets the best Query found so far
      java.lang.String getBestQueryString()
      Gets the best query String found so far
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • full

        protected boolean full
      • bestQueryString

        protected java.lang.String bestQueryString
    • Constructor Detail

      • BestQueryLogger

        public BestQueryLogger​(boolean full)
        Constructs a BestQueryLogger
        Parameters:
        full - true for a full log entry, false for a summary of each query
    • Method Detail

      • add

        public void add​(Query q)
        Allows a Query to be added to this tracker.
        Specified by:
        add in class BestQuery
        Parameters:
        q - a Query to be added to the tracker
      • add

        public void add​(java.lang.String q)
        Allows a Query to be added to this tracker.
        Specified by:
        add in class BestQuery
        Parameters:
        q - a query String to be added to the tracker
      • getBestQuery

        public Query getBestQuery()
        Gets the best Query found so far
        Specified by:
        getBestQuery in class BestQuery
        Returns:
        the best Query, or null if no Queries added to this object
      • getBestQueryString

        public java.lang.String getBestQueryString()
        Gets the best query String found so far
        Specified by:
        getBestQueryString in class BestQuery
        Returns:
        the best Query, or null if no Queries added to this object