Class SearchContentHandlerDebugger

  • All Implemented Interfaces:
    SearchContentHandler

    public class SearchContentHandlerDebugger
    extends java.lang.Object
    implements SearchContentHandler
    This class prints to a PrintStream calls to the SearchContentHandler interface in human readable form. Use to debug parser/adaptor classes that output to the SearchContentHandler interface.
    Author:
    David Huen
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHitProperty​(java.lang.Object key, java.lang.Object value)
      The addHitProperty method adds a key/value pair containing some property of a particular hit.
      void addSearchProperty​(java.lang.Object key, java.lang.Object value)
      The addSearchProperty method adds a key/value pair containing some property of the overall search result.
      void addSubHitProperty​(java.lang.Object key, java.lang.Object value)
      The addSubHitProperty method adds a key/value pair containing some property of a particular subhit.
      void endHeader()
      The endHeader method indicates the end of a formatted header.
      void endHit()
      The endHit method indicates the end of a formatted hit.
      void endSearch()
      The endSearch method indicates the end of useful search information.
      void endSubHit()
      The endSubHit method indicates the end of a formatted subhit.
      boolean getMoreSearches()
      getMoreSearches returns the state of the SearchContentHandler with respect to further searches from its data source.
      void setDatabaseID​(java.lang.String databaseID)
      setDatabaseID identifies the database searched by a name, ID or URN.
      void setMoreSearches​(boolean value)
      setMoreSearches sets the state of the SearchContentHandler's expectation of receiving more results.
      void setQueryID​(java.lang.String queryID)
      setQueryID identifies the query sequence by a name, ID or URN.
      void startHeader()
      The startHeader method indicates the start of a formatted header.
      void startHit()
      The startHit method indicates the start of a formatted hit.
      void startSearch()
      The startSearch method indicates the start of useful search information.
      void startSubHit()
      The startSubHit method indicates the start of a formatted subhit.
      • Methods inherited from class java.lang.Object

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

      • SearchContentHandlerDebugger

        public SearchContentHandlerDebugger()
        Create an instance that dumps to System.out.
      • SearchContentHandlerDebugger

        public SearchContentHandlerDebugger​(java.io.PrintStream pStream)
        Parameters:
        pStream - Stream to dump output to.
    • Method Detail

      • addHitProperty

        public void addHitProperty​(java.lang.Object key,
                                   java.lang.Object value)
        Description copied from interface: SearchContentHandler
        The addHitProperty method adds a key/value pair containing some property of a particular hit.
        Specified by:
        addHitProperty in interface SearchContentHandler
        Parameters:
        key - an Object.
        value - an Object.
      • addSubHitProperty

        public void addSubHitProperty​(java.lang.Object key,
                                      java.lang.Object value)
        Description copied from interface: SearchContentHandler
        The addSubHitProperty method adds a key/value pair containing some property of a particular subhit.
        Specified by:
        addSubHitProperty in interface SearchContentHandler
        Parameters:
        key - an Object.
        value - an Object.
      • addSearchProperty

        public void addSearchProperty​(java.lang.Object key,
                                      java.lang.Object value)
        Description copied from interface: SearchContentHandler
        The addSearchProperty method adds a key/value pair containing some property of the overall search result.
        Specified by:
        addSearchProperty in interface SearchContentHandler
        Parameters:
        key - an Object.
        value - an Object.
      • setMoreSearches

        public void setMoreSearches​(boolean value)
        Description copied from interface: SearchContentHandler
        setMoreSearches sets the state of the SearchContentHandler's expectation of receiving more results. Used for handling streams of search results.
        Specified by:
        setMoreSearches in interface SearchContentHandler
        Parameters:
        value - a boolean value.
      • getMoreSearches

        public boolean getMoreSearches()
        Description copied from interface: SearchContentHandler
        getMoreSearches returns the state of the SearchContentHandler with respect to further searches from its data source. Used for handling streams of search results.
        Specified by:
        getMoreSearches in interface SearchContentHandler
        Returns:
        a boolean value.
      • setDatabaseID

        public void setDatabaseID​(java.lang.String databaseID)
        Description copied from interface: SearchContentHandler
        setDatabaseID identifies the database searched by a name, ID or URN.
        Specified by:
        setDatabaseID in interface SearchContentHandler
        Parameters:
        databaseID - a String which should be an unique identifier for the database searched.
      • setQueryID

        public void setQueryID​(java.lang.String queryID)
        Description copied from interface: SearchContentHandler
        setQueryID identifies the query sequence by a name, ID or URN.
        Specified by:
        setQueryID in interface SearchContentHandler
        Parameters:
        queryID - a String which should be an unique identifer for the sequence.
      • startHeader

        public void startHeader()
        Description copied from interface: SearchContentHandler
        The startHeader method indicates the start of a formatted header. This usually contains information relevant to the search as a whole.
        Specified by:
        startHeader in interface SearchContentHandler
      • startHit

        public void startHit()
        Description copied from interface: SearchContentHandler
        The startHit method indicates the start of a formatted hit. This could be a single line, or a block of lines.
        Specified by:
        startHit in interface SearchContentHandler
      • startSubHit

        public void startSubHit()
        Description copied from interface: SearchContentHandler
        The startSubHit method indicates the start of a formatted subhit. There may be zero or more of these per hit.
        Specified by:
        startSubHit in interface SearchContentHandler