Mobios v0.91

mobios.type
Class Spectra

java.lang.Object
  extended by mobios.type.IndexObject
      extended by mobios.type.DoubleVector
          extended by mobios.type.Spectra
All Implemented Interfaces:
Externalizable, Serializable, Comparable<IndexObject>
Direct Known Subclasses:
TandemSpectra

public class Spectra
extends DoubleVector

Represents a spectra. The only difference between a Spectra and a DoubleVector is that the values in a Spectra are sorted from smallest to largest.

Author:
Smriti Ramakrishnan, Rui Mao, Willard
See Also:
Serialized Form

Constructor Summary
Spectra()
          Default Constructor.
Spectra(mobios.db.Table table, int rowID, double[] spectra)
           
Spectra(mobios.db.Table table, int rowID, String spectra)
          Constructor.
 
Method Summary
 IndexObject[] expand()
          This method is necessary to implement bucketing, so that similar objects are only stored once in the database.
 double getMax()
           
 double getMin()
           
 void sortAsc()
          Sorts the Spectra from smallest to largest values.
 
Methods inherited from class mobios.type.DoubleVector
compareTo, compareTo, equals, getData, hashCode, readExternal, size, toString, writeExternal
 
Methods inherited from class mobios.type.IndexObject
getRowID, setRowID, setRowIDLength
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Spectra

public Spectra()
Default Constructor.


Spectra

public Spectra(mobios.db.Table table,
               int rowID,
               String spectra)
Constructor.

Parameters:
table - the table this spectra comes from
rowID - the rowID of this spectra in its table
spectra - a space-separated String of doubles representing a spectra.

Spectra

public Spectra(mobios.db.Table table,
               int rowID,
               double[] spectra)
Parameters:
table - the table this spectra comes from
rowID - the rowID of this spectra in its table
spectra - an array of doubles representing a spectra
Method Detail

sortAsc

public void sortAsc()
Sorts the Spectra from smallest to largest values.


getMin

public double getMin()
Returns:
the smallest value in the Spectra.

getMax

public double getMax()
Returns:
the largest value in the Spectra.

expand

public IndexObject[] expand()
Description copied from class: IndexObject
This method is necessary to implement bucketing, so that similar objects are only stored once in the database. If you do not want to implement bucketing for your object, you can just return an array of length one containing this object.

Overrides:
expand in class DoubleVector
Returns:
an array of IndexObjects

Mobios v0.91

(C) 2002 - 2006 The MoBIoS Group