Last update: 2011-06-23

org.proteios.core
Class Peak

java.lang.Object
  extended by org.proteios.core.BasicItem<PeakData>
      extended by org.proteios.core.Peak
All Implemented Interfaces:
Comparable<Peak>, AccessControlled, Annotatable, Identifiable

public class Peak
extends BasicItem<PeakData>
implements Annotatable, Comparable<Peak>

This class represent peak items. A peak item has information about the peak in a mass spectrometry experiment.

Version:
2.0
Author:
Olle
Last modified
$Date: 2006-06-02 12:33:12Z $

Field Summary
static Item TYPE
          The type of item represented by this class.
 
Constructor Summary
Peak(PeakData peakData)
           
 
Method Summary
 int compareTo(Peak p)
           
static Peak getById(DbControl dc, int id)
          Get a Peak item when you know the id.
 Double getIntensity()
          Get the intensity.
 Double getMassToChargeRatio()
          Get the massToChargeRatio.
 PeakList getPeakList()
          Get the PeakList this peak is created from.
static ItemQuery<Peak> getQuery()
          Get a query that returns peak items.
 Item getType()
          Get the type of item represented by the object.
 boolean isUsed()
          Check that: no item has been created from this peak
 void setIntensity(Double intensity)
          Set the intensity
 void setMassToChargeRatio(Double massToChargeRatio)
          Set the massToChargeRatio
 void setPeakList(PeakList peakList)
          Set the PeakList this peak is created from.
 
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
 

Field Detail

TYPE

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

See Also:
Item.PROTEIOS_PEAK, getType()
Constructor Detail

Peak

public Peak(PeakData peakData)
Method Detail

compareTo

public int compareTo(Peak p)
Specified by:
compareTo in interface Comparable<Peak>

getById

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

Parameters:
dc - The DbControl which will be used for database access.
id - The id of the item to load
Returns:
The Peak item
Throws:
ItemNotFoundException - If an item with the specified id is not found
BaseException - If there is another error

getQuery

public static ItemQuery<Peak> getQuery()
Get a query that returns peak 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

isUsed

public boolean isUsed()
               throws BaseException
Check that:

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

getMassToChargeRatio

public Double getMassToChargeRatio()
Get the massToChargeRatio.

Returns:
A Double holding the massToChargeRatio

setMassToChargeRatio

public void setMassToChargeRatio(Double massToChargeRatio)
                          throws InvalidDataException,
                                 BaseException
Set the massToChargeRatio

Parameters:
massToChargeRatio - The Double massToChargeRatio value
Throws:
InvalidDataException - If massToChargeRatio is below zero
BaseException

getIntensity

public Double getIntensity()
Get the intensity.

Returns:
A Double holding the intensity

setIntensity

public void setIntensity(Double intensity)
                  throws InvalidDataException,
                         BaseException
Set the intensity

Parameters:
intensity - The Double intensity value
Throws:
InvalidDataException - If intensity is below zero
BaseException

getPeakList

public PeakList getPeakList()
                     throws BaseException
Get the PeakList this peak is created from.

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

setPeakList

public void setPeakList(PeakList peakList)
Set the PeakList this peak is created from.

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

Last update: 2011-06-23