Last update: 2011-06-23

org.proteios.core
Class SearchModification

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.Modification<SearchModificationData>
                      extended by org.proteios.core.SearchModification
All Implemented Interfaces:
AccessControlled, Identifiable, Nameable, Ownable, Removable, Shareable

public class SearchModification
extends Modification<SearchModificationData>

This class represent searchModifications.

Version:
2.0
Author:
Fredrik

Nested Class Summary
static class SearchModification.TerminalSpecificity
          This enum is used to verify terminal specificities.
 
Field Summary
static int MAX_AASPECIFICITY_LENGTH
          The maximum length of the amino acid specficity that can be stored in the database.
static Item TYPE
          The type of item represented by this class.
 
Fields inherited from class org.proteios.core.Modification
MAX_CVID_LENGTH, MAX_DIFF_FORMULA_LENGTH
 
Fields inherited from interface org.proteios.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Method Summary
 String getAminoAcidSpecificity()
          Get the amino acid specificity of the modification.
 Set<Annotatable> getAnnotatableParents()
          Always null.
static ItemQuery<SearchModification> getQuery()
          Get a query that returns searchModification items.
 SpectrumSearch getSpectrumSearch()
          Get the SpectrumSearch this SearchModification is associated with.
 SearchModification.TerminalSpecificity getTerminalSpecificity()
          The enum representation of the int value in the database is returned.
 Item getType()
          Get the type of item represented by the object.
 boolean isFixed()
           
 boolean isUsed()
          Check that: no Sample has been created from this searchModification
 void setAminoAcidSpecificity(String aminoAcidSpecificity)
          Set the amino acid specificities of the Modification.
 void setFixed(boolean fixed)
           
 void setSpectrumSearch(SpectrumSearch spectrumSearch)
          Set the SpectrumSearch this SearchModification is associated with.
 void setTerminalSpecificity(SearchModification.TerminalSpecificity terminalSpecificity)
          The terminalSpecificity is converted to the ordinal in the enum before it is sent to the data layer.
 
Methods inherited from class org.proteios.core.Modification
getAverageDeltaMass, getAverageMass, getCvId, getDiffFormula, getMonoisotopicDeltaMass, getMonoisotopicMass, getPosition, isSubstitutionModification, setAverageDeltaMass, setAverageMass, setCvId, setDiffFormula, setMonoisotopicDeltaMass, setMonoisotopicMass, setPosition, setSubstitutionModification
 
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_SEARCHMODIFICATION, getType()

MAX_AASPECIFICITY_LENGTH

public static final int MAX_AASPECIFICITY_LENGTH
The maximum length of the amino acid specficity that can be stored in the database.

See Also:
setAminoAcidSpecificity(String), Constant Field Values
Method Detail

getQuery

public static ItemQuery<SearchModification> getQuery()
Get a query that returns searchModification 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.

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<SearchModificationData>
Returns:
TRUE if this item is used, FALSE otherwise
Throws:
BaseException

getSpectrumSearch

public SpectrumSearch getSpectrumSearch()
                                 throws BaseException
Get the SpectrumSearch this SearchModification 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 SearchModification is associated with.

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

getTerminalSpecificity

public SearchModification.TerminalSpecificity getTerminalSpecificity()
The enum representation of the int value in the database is returned. The String representation of the TerminalSpecificity can be obtained by toString().

Returns:
terminalSpecificity The terminal specificity

setTerminalSpecificity

public void setTerminalSpecificity(SearchModification.TerminalSpecificity terminalSpecificity)
The terminalSpecificity is converted to the ordinal in the enum before it is sent to the data layer.

Parameters:
terminalSpecificity - The terminalSpecificity to set.

isFixed

public boolean isFixed()
Returns:
Returns the fixed modififcation flag

setFixed

public void setFixed(boolean fixed)
Parameters:
fixed - Whether the modification is static.

getAminoAcidSpecificity

public String getAminoAcidSpecificity()
Get the amino acid specificity of the modification. Should be amino acid one letter codes

Returns:
The amino acid for the modification

setAminoAcidSpecificity

public void setAminoAcidSpecificity(String aminoAcidSpecificity)
                             throws PermissionDeniedException,
                                    InvalidDataException
Set the amino acid specificities of the Modification. The amino acids should be gven as single letter values. The value may be null but must not be longer than the value specified by the MAX_AASPECIFICITY_LENGTH constant.

Parameters:
aminoAcidSpecificity - The amino acid specificities
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission
InvalidDataException - If the string is too long

Last update: 2011-06-23