Class SearchContentAdapter

java.lang.Object
org.biojava.bio.search.SearchContentAdapter
All Implemented Interfaces:
SearchContentHandler
Direct Known Subclasses:
FilteringContentHandler

public class SearchContentAdapter extends Object implements SearchContentHandler

An adapter for SearchContentHandler.

This adapter is in the same spirit as the event handler adapters in java.awt.event, and is intended as a simple base-class for implementations that only want to handle a small number of the possible call-backs. All method implementations are empty except for getMoreSearches() and setMoreSearches(). These two maintain a boolean state between calls. If you over-ride one, you should override the other.

Example

 // a very boring handler
 SearchContentHanlder ignoreEverything = new SearchContentAdapter();

 // just respond to sub hit properties
 SearchContentHander subHitsOnly = new SearchContentAdapter() {
   public void addSubHitProperth(Object key, Object value) {
     System.out.println(key + " -> " + value);
   }
 };
 
Since:
1.3
Author:
Matthew Pocock
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    The addHitProperty method adds a key/value pair containing some property of a particular hit.
    void
    The addSearchProperty method adds a key/value pair containing some property of the overall search result.
    void
    The addSubHitProperty method adds a key/value pair containing some property of a particular subhit.
    void
    The endHeader method indicates the end of a formatted header.
    void
    The endHit method indicates the end of a formatted hit.
    void
    The endSearch method indicates the end of useful search information.
    void
    The endSubHit method indicates the end of a formatted subhit.
    boolean
    getMoreSearches returns the state of the SearchContentHandler with respect to further searches from its data source.
    void
    setDatabaseID(String databaseID)
    setDatabaseID identifies the database searched by a name, ID or URN.
    void
    setMoreSearches(boolean val)
    setMoreSearches sets the state of the SearchContentHandler's expectation of receiving more results.
    void
    setQueryID(String queryID)
    setQueryID identifies the query sequence by a name, ID or URN.
    void
    The startHeader method indicates the start of a formatted header.
    void
    The startHit method indicates the start of a formatted hit.
    void
    The startSearch method indicates the start of useful search information.
    void
    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