Last update: 2011-06-23

org.proteios.core
Class Peptide

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<D>
                      extended by org.proteios.core.PolyPeptide<PeptideData>
                          extended by org.proteios.core.Peptide
All Implemented Interfaces:
AccessControlled, Annotatable, Identifiable, Nameable, Ownable, Removable, Shareable

public class Peptide
extends PolyPeptide<PeptideData>

This class represent peptide.

Version:
2.0
Author:
Fredrik

Field Summary
static int MAX_POSTSEQUENCE_LENGTH
          The maximum length of the postSequence string that can be stored in the database.
static int MAX_PRESEQUENCE_LENGTH
          The maximum length of the preSequence string 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.PolyPeptide
MAX_ACCESSION_NUMBER_LENGTH, MAX_LSID_LENGTH, MAX_SEQUENCE_LENGTH
 
Fields inherited from interface org.proteios.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Method Summary
 Set<Annotatable> getAnnotatableParents()
          Always null.
static Peptide getById(DbControl dc, int id)
          Get an Peptide item when you know the id.
 int getEndPosition()
           
 String getPostSequence()
          Get the sequence before this peptide.
 String getPreSequence()
          Get the sequence before this peptide.
static ItemQuery<Peptide> getQuery()
          Get a query that returns protein items.
 int getStartPosition()
           
 Item getType()
          Get the type of item represented by the object.
 boolean isUsed()
          Check that: no Sample has been created from this protein
 void setEndPosition(int endPosition)
           
 void setPostSequence(String postSequence)
          Set the postSequence for this SearchResult item.
 void setPreSequence(String preSequence)
          Set the preSequence for this SearchResult item.
 void setStartPosition(int startPosition)
           
 
Methods inherited from class org.proteios.core.PolyPeptide
addObservedModification, getAccessionNumber, getLsid, getObservedModifications, getSearchResult, getSequence, setAccessionNumber, setLsid, setObservedModifications, setSearchResult, setSequence
 
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_PEPTIDE, getType()

MAX_PRESEQUENCE_LENGTH

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

See Also:
setPreSequence(String), Constant Field Values

MAX_POSTSEQUENCE_LENGTH

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

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

getById

public static Peptide getById(DbControl dc,
                              int id)
                       throws ItemNotFoundException,
                              PermissionDeniedException,
                              BaseException
Get an Peptide item when you know the id.

Parameters:
dc - The DbControl which will be used for permission checking and database access.
id - The id of the item to load
Returns:
The Peptide item
Throws:
ItemNotFoundException - If an item with the specified id is not found
PermissionDeniedException - If the logged in user doesn't have read permission to the item
BaseException - If there is another error

getQuery

public static ItemQuery<Peptide> getQuery()
Get a query that returns protein 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<PeptideData>
Returns:
TRUE if this item is used, FALSE otherwise
Throws:
BaseException

getPreSequence

public String getPreSequence()
Get the sequence before this peptide.

Returns:
the pre sequence

setPreSequence

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

Parameters:
preSequence - The new preSequence for this item
Throws:
InvalidDataException - If the preSequence is longer than MAX_PRESEQUENCE_LENGTH

getPostSequence

public String getPostSequence()
Get the sequence before this peptide.

Returns:
the post sequence

setPostSequence

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

Parameters:
postSequence - The new postSequence for this item
Throws:
InvalidDataException - If the postSequence is longer than MAX_POSTSEQUENCE_LENGTH

getStartPosition

public int getStartPosition()
Returns:
Returns the startPosition.

setStartPosition

public void setStartPosition(int startPosition)
Parameters:
startPosition - The startPosition to set.

getEndPosition

public int getEndPosition()
Returns:
Returns the endPosition.

setEndPosition

public void setEndPosition(int endPosition)
Parameters:
endPosition - The endPosition to set.

Last update: 2011-06-23