maltcms.datastructures.caches
Class SparseScanLineCache

java.lang.Object
  extended by maltcms.datastructures.caches.SparseScanLineCache
All Implemented Interfaces:
cross.IConfigurable, Serializable, IScanLine

public class SparseScanLineCache
extends Object
implements IScanLine

This class is a dataholder for mass spectra. This class will cache all mass spectra which were read an hold a SoftReference to it. TODO: Change to AScanLineCache

Author:
Mathias Wilhelm(mwilhelm A T TechFak.Uni-Bielefeld.DE)
See Also:
Serialized Form

Method Summary
 void clear()
          
 void configure(org.apache.commons.configuration.Configuration cfg)
          
 int getBinsSize()
          Getter.
 boolean getCacheModulation()
          Getter.
 int getLastIndex()
          Getter.
 Array getMassSpectra(int x, int y)
          Getter for one mass spectra.
 Array getMassSpectra(Point p)
          This Method is a wrapper for getMassPectra(int, int).
 int getScanLineCount()
          Getter.
 List<Array> getScanlineMS(int x)
          Getter.
 List<cross.datastructures.tuple.Tuple2D<Array,Array>> getScanlineSparseMS(int x)
           
 int getScansPerModulation()
          Getter.
 cross.datastructures.tuple.Tuple2D<Array,Array> getSparseMassSpectra(int x, int y)
           
 cross.datastructures.tuple.Tuple2D<Array,Array> getSparseMassSpectra(Point p)
           
 Point mapIndex(int scanIndex)
          Map a global scan index to a Point of x,y coordinates.
 int mapPoint(int x, int y)
          Map two coordinates x,y to a global scan index.
 int mapPoint(Point p)
          Map a Point to a global scan index.
 void setBinSize(int size)
          Setter.
 void setCacheModulations(boolean cacheMod)
          Setter.
 void setLastIndex(int index)
          Setter.
 void showStat()
          Will view some statistical information about the cache usage.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

configure

public void configure(org.apache.commons.configuration.Configuration cfg)

Specified by:
configure in interface cross.IConfigurable

getBinsSize

public int getBinsSize()
Getter.

Specified by:
getBinsSize in interface IScanLine
Returns:
bin size

getCacheModulation

public boolean getCacheModulation()
Getter.

Specified by:
getCacheModulation in interface IScanLine
Returns:

getLastIndex

public int getLastIndex()
Getter.

Specified by:
getLastIndex in interface IScanLine
Returns:
last index

getMassSpectra

public Array getMassSpectra(int x,
                            int y)
Getter for one mass spectra. If the requested mass spectra is out of bound, then this method will return null.

Specified by:
getMassSpectra in interface IScanLine
Parameters:
x - scanline number
y - mass spectra inside this scanline
Returns:
array representing one mass spectra

getMassSpectra

public Array getMassSpectra(Point p)
This Method is a wrapper for getMassPectra(int, int).

Specified by:
getMassSpectra in interface IScanLine
Parameters:
p - point of requested mass spectra
Returns:
mass spectra

getScanLineCount

public int getScanLineCount()
Getter.

Specified by:
getScanLineCount in interface IScanLine
Returns:
scan line count

getScanlineMS

public List<Array> getScanlineMS(int x)
Getter.

Specified by:
getScanlineMS in interface IScanLine
Parameters:
x - scan line number
Returns:
complete ms list of this scan line

getScansPerModulation

public int getScansPerModulation()
Getter.

Specified by:
getScansPerModulation in interface IScanLine
Returns:
scans per modulation

setBinSize

public void setBinSize(int size)
Setter.

Specified by:
setBinSize in interface IScanLine
Parameters:
size - bin size

setCacheModulations

public void setCacheModulations(boolean cacheMod)
Setter. Default value is true.

Specified by:
setCacheModulations in interface IScanLine
Parameters:
cacheMod - true if all modulations should be cached

setLastIndex

public void setLastIndex(int index)
Setter.

Specified by:
setLastIndex in interface IScanLine
Parameters:
index - last index

showStat

public void showStat()
Will view some statistical information about the cache usage.

Specified by:
showStat in interface IScanLine

getScanlineSparseMS

public List<cross.datastructures.tuple.Tuple2D<Array,Array>> getScanlineSparseMS(int x)
Specified by:
getScanlineSparseMS in interface IScanLine

getSparseMassSpectra

public cross.datastructures.tuple.Tuple2D<Array,Array> getSparseMassSpectra(int x,
                                                                            int y)
Specified by:
getSparseMassSpectra in interface IScanLine

getSparseMassSpectra

public cross.datastructures.tuple.Tuple2D<Array,Array> getSparseMassSpectra(Point p)
Specified by:
getSparseMassSpectra in interface IScanLine

mapIndex

public Point mapIndex(int scanIndex)
Description copied from interface: IScanLine
Map a global scan index to a Point of x,y coordinates.

Specified by:
mapIndex in interface IScanLine
Returns:

mapPoint

public int mapPoint(int x,
                    int y)
Description copied from interface: IScanLine
Map two coordinates x,y to a global scan index.

Specified by:
mapPoint in interface IScanLine
Returns:

mapPoint

public int mapPoint(Point p)
Description copied from interface: IScanLine
Map a Point to a global scan index.

Specified by:
mapPoint in interface IScanLine
Returns:

clear

public void clear()

Specified by:
clear in interface IScanLine


Copyright © 2007-2012. All Rights Reserved.