## org.biojava.bio.search
Class SimpleSeqSimilaritySearchResult

    java.lang.Object
      org.biojava.utils.AbstractChangeable
          org.biojava.bio.search.SimpleSeqSimilaritySearchResult

All Implemented Interfaces:
  Annotatable, SeqSimilaritySearchResult, Changeable

    public class SimpleSeqSimilaritySearchResult

extends AbstractChangeable
implements SeqSimilaritySearchResult

`SimpleSeqSimilaritySearchResult` objects represent a result of a search of a `SymbolList` against the sequences within a `SequenceDB` object. The core data (query sequence, database, search parameters, hits) have accessors, while supplementary data are stored in the `Annotation` object. Supplementary data are typically the more loosely formatted details which vary from one search program to another (and between versions of those programs).

Since:
  1.1
Author:
  Keith James, Gerald Loeffler
See Also:
  `AbstractChangeable`, `SeqSimilaritySearchResult`, `Annotatable`

Nested Class Summary

Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
`Annotatable.AnnotationForwarder`

Field Summary
`protected ChangeForwarder` `annotationForwarder`

Fields inherited from interface org.biojava.bio.Annotatable
`ANNOTATION`

Constructor Summary
`SimpleSeqSimilaritySearchResult(Sequence querySequence, SequenceDB sequenceDB, Map searchParameters, List hits, Annotation annotation)` Creates a new `SimpleSeqSimilaritySearchResult`.

Method Summary
`boolean` `equals(Object other)`
`Annotation` `getAnnotation()` `getAnnotation` returns the Annotation associated with this hit.
`protected ChangeSupport` `getChangeSupport(ChangeType ct)` Called to retrieve the ChangeSupport for this object.
`List` `getHits()` Return all hits in this sequence similarity search result.
`Sequence` `getQuerySequence()` Returns the query sequence which was used to perform the search.
`Map` `getSearchParameters()` Returns the search parameters used in the search that produced this search result.
`SequenceDB` `getSequenceDB()` Returns the sequence database against which the search was performed.
`int` `hashCode()`
`String` `toString()`

Methods inherited from class org.biojava.utils.AbstractChangeable
`addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.biojava.utils.Changeable
`addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener`

Field Detail

### annotationForwarder

    protected transient ChangeForwarder annotationForwarder

Constructor Detail

### SimpleSeqSimilaritySearchResult

    public SimpleSeqSimilaritySearchResult(Sequence querySequence,
                                           SequenceDB sequenceDB,
                                           Map searchParameters,
                                           List hits,
                                           Annotation annotation)

  Creates a new `SimpleSeqSimilaritySearchResult`.

  Parameters:
    `querySequence` - a `Sequence`.
    `sequenceDB` - a `SequenceDB`.
    `searchParameters` - a `Map`.
    `annotation` - an `Annotation`.
    `hits` - a `List`.

Method Detail

### getQuerySequence

    public Sequence getQuerySequence()

  Description copied from interface: `SeqSimilaritySearchResult`
  Returns the query sequence which was used to perform the search.

  Specified by:
    `getQuerySequence` in interface `SeqSimilaritySearchResult`
  Returns:
    the `Sequence` object used to search the `SequenceDB`. Never returns null.

### getSequenceDB

    public SequenceDB getSequenceDB()

  Description copied from interface: `SeqSimilaritySearchResult`
  Returns the sequence database against which the search was performed.

  Specified by:
    `getSequenceDB` in interface `SeqSimilaritySearchResult`
  Returns:
    the `SequenceDB object` against which the search was carried out. Never returns null.

### getSearchParameters

    public Map getSearchParameters()

  Description copied from interface: `SeqSimilaritySearchResult`
  Returns the search parameters used in the search that produced this search result.

  Specified by:
    `getSearchParameters` in interface `SeqSimilaritySearchResult`
  Returns:
    the (immutable) search parameter `Map object`. May return null.

### getHits

    public List getHits()

  Description copied from interface: `SeqSimilaritySearchResult`
  Return all hits in this sequence similarity search result. The hits are sorted from best to worst.

  Specified by:
    `getHits` in interface `SeqSimilaritySearchResult`
  Returns:
    an (immutable) `List` of `SeqSimilaritySearchHit` objects containing all hits in the search result. Never returns null but may return an empty list.

### getAnnotation

    public Annotation getAnnotation()

  `getAnnotation` returns the Annotation associated with this hit.

  Specified by:
    `getAnnotation` in interface `Annotatable`
  Returns:
    an `Annotation`.

### equals

    public boolean equals(Object other)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### getChangeSupport

    protected ChangeSupport getChangeSupport(ChangeType ct)

  Description copied from class: `AbstractChangeable`
  Called to retrieve the ChangeSupport for this object.

  Your implementation of this method should have the following structure: ``

       ChangeSupport cs = super.getChangeSupport(ct);

       if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) {
         someForwarder = new ChangeForwarder(...

         this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange);
       }

       return cs;

  It is usual for the forwarding listeners (someForwarder in this example) to be transient and lazily instantiated. Be sure to register & unregister the forwarder in the code that does the ChangeEvent handling in setter methods.

  Overrides:
    `getChangeSupport` in class `AbstractChangeable`