public class LCMSData extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
protected class |
LCMSData.User
This is a PhantomRef for the object, that requests loading of data,
so we could track it being garbage collected.
|
| Modifier and Type | Field and Description |
|---|---|
protected static com.google.common.base.FinalizableReferenceQueue |
FRQ |
protected boolean |
isReleasingMemory |
protected IScanCollection |
scans |
protected LCMSDataSource<?> |
source |
| Constructor and Description |
|---|
LCMSData(LCMSDataSource<?> source)
Will create LCMSData backed up by
ScanCollectionDefault with
spectra auto-loading turned off. |
LCMSData(LCMSDataSource<?> source,
IScanCollection scans)
You can pass you IScanCollection implementation, but you likely won't
want to do that.
|
| Modifier and Type | Method and Description |
|---|---|
IScanCollection |
getScans() |
LCMSDataSource<?> |
getSource() |
boolean |
isLoaded(LCMSDataSubset subset)
Checks among the loaded by all users if this particular subset has already
been loaded by someone else.
|
void |
load(LCMSDataSubset subset)
Will load scan meta-info and spectra for the specified subset.
|
void |
load(LCMSDataSubset subset,
Object user)
Will load scan meta-info and spectra for the specified subset.
|
void |
releaseMemory()
Releases all memory by calling
LCMSDataSource.releaseMemory() and
IScanCollection.reset(). |
void |
unload(LCMSDataSubset subset)
Unloads spectra matched by this subset.
|
void |
unload(LCMSDataSubset subset,
Object user,
Set<LCMSDataSubset> exclude)
Unloads spectra matched by this subset.
|
protected static final transient com.google.common.base.FinalizableReferenceQueue FRQ
protected LCMSDataSource<?> source
protected IScanCollection scans
protected volatile boolean isReleasingMemory
public LCMSData(LCMSDataSource<?> source)
ScanCollectionDefault with
spectra auto-loading turned off.source - public LCMSData(LCMSDataSource<?> source, IScanCollection scans)
source - scans - public LCMSDataSource<?> getSource()
public IScanCollection getScans()
public boolean isLoaded(LCMSDataSubset subset)
StorageStrategy other than
StorageStrategy.STRONG, this check won't guarantee anything other
than the scan meta info was loaded. Spectra might have been garbage collected.
You can remedy this by setting IScanCollection.isAutoloadSpectra(boolean)
true, in which case spectra will be automatically loaded, whenever
spectrum references are null.subset - public void load(LCMSDataSubset subset) throws FileParsingException
unload(umich.ms.datatypes.LCMSDataSubset).subset - FileParsingExceptionpublic void load(LCMSDataSubset subset, Object user) throws FileParsingException
unload(umich.ms.datatypes.LCMSDataSubset).subset - user - identify yourself somehow, other components might be using this
LCMSData as well, so if you don't provide that identifier, there is no
way to tell, for example, when unloading a subset if it's in use by you
or someone else. So some other component, might call unload() and without
the identifier your spectra will be lost.FileParsingExceptionpublic void unload(LCMSDataSubset subset)
subset - public void unload(LCMSDataSubset subset, Object user, Set<LCMSDataSubset> exclude)
subset - to be unloadeduser - the user, that has had this subset loaded. If other users have
parts of this subset loaded, those parts won't be unloaded.exclude - can be null. If specified, data from these subsets won't be excluded.public void releaseMemory()
LCMSDataSource.releaseMemory() and
IScanCollection.reset(). Effectively, you get this object to the
same state as it was after calling the constructor, however any
ScanCollection configurations are preserved (e.g. spectra auto-loading)
setting.
IMPORTANT: will clear the registry of loaded subsets without warning!
It's up to you to make sure you don't call this method while some
component is still using the data.Copyright © 2017. All rights reserved.