Last update: 2011-06-23

org.proteios.core
Class SearchResult

java.lang.Object
  extended by org.proteios.core.BasicItem<D>
      extended by org.proteios.core.OwnedItem<D>
          extended by org.proteios.core.SharedItem<D>
              extended by org.proteios.core.CommonItem<D>
                  extended by org.proteios.core.AnnotatedItem<SearchResultData>
                      extended by org.proteios.core.SearchResult
All Implemented Interfaces:
Comparable<SearchResult>, AccessControlled, Annotatable, Identifiable, Nameable, Ownable, Removable, Shareable

public class SearchResult
extends AnnotatedItem<SearchResultData>
implements Comparable<SearchResult>

This class represent spectrumsearch.

Version:
2.0
Author:
Fredrik
Last modified
$Date: 2009-04-09 08:48:11 +0200 (Thu, 09 Apr 2009) $

Field Summary
static int MAX_SCORETYPE_LENGTH
          The maximum length of the scoreType string that can be stored in the database.
static int MAX_SPECTRUMSTRINGID_LENGTH
           
static Item TYPE
          The type of item represented by this class.
 
Fields inherited from interface org.proteios.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Method Summary
 void addPolyPeptide(PolyPeptide pp)
          Add a PolyPeptide to the collection.
 void addReferencedResult(SearchResult referencedResult)
          Add a result to the list of referenced results.
 int compareTo(SearchResult o)
           
 Set<Annotatable> getAnnotatableParents()
          Always null.
 Float getExpectationValue()
           
 int getIndex()
           
 int getInputSpectrumId()
           
 PeakList getPeakList()
          Get the PeakList this SearchResult is associated with.
 Set<Peptide> getPeptides()
          Get the Peptide polypeptides.
 Set<PolyPeptide> getPolyPeptides()
           
 Set<Protein> getProteins()
          Get the Peptide polypeptides.
static ItemQuery<SearchResult> getQuery()
          Get a query that returns spectrumsearchset items.
 List<SearchResult> getReferencedResults()
          Get the SearchResult referenced results.
 Float getScore()
           
 String getScoreType()
          Get the input filename of this SearchResult.
 SpectrumSearch getSpectrumSearch()
          Get the SpectrumSearch this SearchResult is associated with.
 String getSpectrumStringId()
           
 Item getType()
          Get the type of item represented by the object.
 boolean isUsed()
          Check that: no item has been created from this peaklistset
 void setExpectationValue(Float eValue)
           
 void setIndex(int index)
           
 void setInputSpectrumId(int inputSpectrumId)
           
 void setPeakList(PeakList peakList)
          Set the PeakList this SearchResult is associated with.
 void setPolyPeptides(Set<PolyPeptide> polyPeptides)
          Set the PolyPeptide polypeptides
 void setReferencedResults(List<SearchResult> referencedResults)
          Set the SearchResult referenced results.
 void setScore(Float score)
           
 void setScoreType(String scoreType)
          Set the scoreType for this SearchResult item.
 void setSpectrumSearch(SpectrumSearch spectrumSearch)
          Set the SpectrumSearch this SearchResult is associated with.
 void setSpectrumStringId(String spectrumStringId)
          Set the spectrumStringId for this SearchResult item.
 
Methods inherited from class org.proteios.core.CommonItem
getDescription, getName, isRemoved, setDescription, setName, setRemoved
 
Methods inherited from class org.proteios.core.SharedItem
getItemKey, getProjectKey, isShared, setItemKey, setProjectKey
 
Methods inherited from class org.proteios.core.OwnedItem
getOwner, setOwner
 
Methods inherited from class org.proteios.core.BasicItem
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.proteios.core.Identifiable
getId, getVersion
 
Methods inherited from interface org.proteios.core.AccessControlled
checkPermission, hasPermission
 
Methods inherited from interface org.proteios.core.Ownable
getOwner, setOwner
 

Field Detail

TYPE

public static final Item TYPE
The type of item represented by this class.

See Also:
Item.PROTEIOS_SEARCHRESULT, getType()

MAX_SCORETYPE_LENGTH

public static final int MAX_SCORETYPE_LENGTH
The maximum length of the scoreType string that can be stored in the database.

See Also:
setScoreType(String), Constant Field Values

MAX_SPECTRUMSTRINGID_LENGTH

public static final int MAX_SPECTRUMSTRINGID_LENGTH
See Also:
Constant Field Values
Method Detail

compareTo

public int compareTo(SearchResult o)
Specified by:
compareTo in interface Comparable<SearchResult>

getQuery

public static ItemQuery<SearchResult> getQuery()
Get a query that returns spectrumsearchset items.

Returns:
An ItemQuery object.

getType

public Item getType()
Description copied from interface: Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in the Item enumeration.

Specified by:
getType in interface Identifiable
Returns:
A value indicating the type of item

getAnnotatableParents

public Set<Annotatable> getAnnotatableParents()
                                       throws BaseException
Always null.

Throws:
BaseException

isUsed

public boolean isUsed()
               throws BaseException
Check that:

Specified by:
isUsed in class BasicItem<SearchResultData>
Returns:
TRUE if this item is used, FALSE otherwise
Throws:
BaseException

getPeakList

public PeakList getPeakList()
                     throws BaseException
Get the PeakList this SearchResult is associated with.

Returns:
The PeakList item or null if not known
Throws:
BaseException - If there is another error

setPeakList

public void setPeakList(PeakList peakList)
                 throws BaseException
Set the PeakList this SearchResult is associated with.

Parameters:
peakList - The new PeakList item
Throws:
BaseException - If there is another error

getSpectrumSearch

public SpectrumSearch getSpectrumSearch()
                                 throws BaseException
Get the SpectrumSearch this SearchResult is associated with.

Returns:
The SpectrumSearch item or null if not known
Throws:
BaseException - If there is another error

setSpectrumSearch

public void setSpectrumSearch(SpectrumSearch spectrumSearch)
                       throws BaseException
Set the SpectrumSearch this SearchResult is associated with.

Parameters:
spectrumSearch - The new SpectrumSearch item
Throws:
BaseException - If there is another error

getIndex

public int getIndex()
Returns:
Returns the index used for sorting.

setIndex

public void setIndex(int index)
Parameters:
index - The index for sorting.

getInputSpectrumId

public int getInputSpectrumId()
Returns:
Returns the inputSpectrumId.

setInputSpectrumId

public void setInputSpectrumId(int inputSpectrumId)
Parameters:
inputSpectrumId - The inputSpectrumId to set.

getScore

public Float getScore()
Returns:
Returns the score.

setScore

public void setScore(Float score)
Parameters:
score - The primary score.

getExpectationValue

public Float getExpectationValue()
Returns:
Returns the expectation value.

setExpectationValue

public void setExpectationValue(Float eValue)
Parameters:
eValue - The primary expectation value.

getScoreType

public String getScoreType()
Get the input filename of this SearchResult.

Returns:
the filename

setScoreType

public void setScoreType(String scoreType)
                  throws InvalidDataException
Set the scoreType for this SearchResult item. The value may be null but must not be longer than the value specified by the MAX_SCORETYPE_LENGTH constant.

Parameters:
scoreType - The new scoreType for this item
Throws:
InvalidDataException - If the scoreType is longer than MAX_SCORETYPE_LENGTH

getSpectrumStringId

public String getSpectrumStringId()
Returns:
Returns the spectrumStringId.

setSpectrumStringId

public void setSpectrumStringId(String spectrumStringId)
                         throws InvalidDataException
Set the spectrumStringId for this SearchResult item. The value may be null but must not be longer than the value specified by the

Parameters:
spectrumStringId - The spectrumStringId to set.
Throws:
InvalidDataException - If the spectrumStringId is longer than MAX_SPECTRUMSTRINGID_LENGTH

getReferencedResults

public List<SearchResult> getReferencedResults()
                                        throws ItemNotFoundException,
                                               BaseException
Get the SearchResult referenced results.

Returns:
A SearchResult list object
Throws:
BaseException - If there is another error
ItemNotFoundException

setReferencedResults

public void setReferencedResults(List<SearchResult> referencedResults)
                          throws InvalidDataException
Set the SearchResult referenced results.

Parameters:
referencedResults - The new SearchResult list item
Throws:
BaseException - If there is another error
InvalidDataException

addReferencedResult

public void addReferencedResult(SearchResult referencedResult)
Add a result to the list of referenced results.


getPolyPeptides

public Set<PolyPeptide> getPolyPeptides()
                                 throws ItemNotFoundException,
                                        BaseException
Throws:
ItemNotFoundException
BaseException

setPolyPeptides

public void setPolyPeptides(Set<PolyPeptide> polyPeptides)
                     throws InvalidDataException
Set the PolyPeptide polypeptides

Parameters:
polyPeptides - The new PolyPeptide set item
Throws:
BaseException - If there is another error
InvalidDataException

addPolyPeptide

public void addPolyPeptide(PolyPeptide pp)
Add a PolyPeptide to the collection. Backward reference is set

Parameters:
pp - the PolyPeptide to set

getPeptides

public Set<Peptide> getPeptides()
                         throws ItemNotFoundException,
                                BaseException
Get the Peptide polypeptides. Only returns peptides from the polypeptide collection

Returns:
A Peptide set object
Throws:
BaseException - If there is another error
ItemNotFoundException

getProteins

public Set<Protein> getProteins()
                         throws ItemNotFoundException,
                                BaseException
Get the Peptide polypeptides. Only returns peptides from the polypeptide collection

Returns:
A Peptide set object
Throws:
BaseException - If there is another error
ItemNotFoundException

Last update: 2011-06-23