gov.nist.microanalysis.EPQLibrary
Class DerivedSpectrum

java.lang.Object
  extended by gov.nist.microanalysis.EPQLibrary.BaseSpectrum
      extended by gov.nist.microanalysis.EPQLibrary.DerivedSpectrum
All Implemented Interfaces:
ISpectrumData, java.lang.Comparable
Direct Known Subclasses:
NoisySpectrum, SpectrumMath

public abstract class DerivedSpectrum
extends BaseSpectrum

A spectrum derived from another spectrum. The number of channels, channel width, zero offset and base properties are all tied together. SpectrumProperties is designed so that that modification of the properties of a DerivedSpectrum will not modify the properties of the base ISpectrumData.

DerivedSpectrum is abstract (getCounts()). Usually getCounts() is implemented as some function of mSource.getCounts().

Copyright: Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain

Company: National Institute of Standards and Technology

Version:
1.0
Author:
Nicholas W. M. Ritchie

Field Summary
protected  ISpectrumData mSource
           
 
Fields inherited from class gov.nist.microanalysis.EPQLibrary.BaseSpectrum
mHashCode, NULL_HASH, NullSpectrum
 
Constructor Summary
DerivedSpectrum(ISpectrumData src)
          DerivedSpectrum - Create a new DerivedSpectrum based on the specified source spectrum.
 
Method Summary
 boolean equals(java.lang.Object obj)
          equals - Overrides equals to handle the special case in which the channel data and the SpecimenDesc are the same but the derived spectrum represents some modification of the original.
 ISpectrumData getBaseSpectrum()
          getBaseSpectrum - Return the spectrum on which this one was based.
 int getChannelCount()
          getChannelCount - see ISpectrumData
 double getChannelWidth()
          getChannelWidth - see ISpectrumData
 SpectrumProperties getProperties()
          getProperties - see ISpectrumData
 double getZeroOffset()
          getZeroOffset - see ISpectrumData
 boolean isAlreadyDerivedFrom(java.lang.Class cls)
          isAlreadyDerivedFrom - Sometimes it is a bad idea to derive a spectrum from a class from which it is already derived.
 boolean isDerivedFrom(ISpectrumData spec)
          isDerivedFrom - Is this spectrum derived from the argument spectrum? (Recursively checks the whole chain of derivation if this derived spectrum is derived from yet another.)
 
Methods inherited from class gov.nist.microanalysis.EPQLibrary.BaseSpectrum
compareTo, hashCode, initializeSpectrumIndex, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nist.microanalysis.EPQLibrary.ISpectrumData
getCounts
 

Field Detail

mSource

protected ISpectrumData mSource
Constructor Detail

DerivedSpectrum

public DerivedSpectrum(ISpectrumData src)
DerivedSpectrum - Create a new DerivedSpectrum based on the specified source spectrum.

Parameters:
src - ISpectrumData
Method Detail

getChannelCount

public final int getChannelCount()
getChannelCount - see ISpectrumData

Returns:
int

getChannelWidth

public final double getChannelWidth()
getChannelWidth - see ISpectrumData

Returns:
double

getZeroOffset

public final double getZeroOffset()
getZeroOffset - see ISpectrumData

Returns:
double

getProperties

public final SpectrumProperties getProperties()
getProperties - see ISpectrumData

Returns:
SpectrumProperties

getBaseSpectrum

public final ISpectrumData getBaseSpectrum()
getBaseSpectrum - Return the spectrum on which this one was based.

Returns:
ISpectrumData

isDerivedFrom

public boolean isDerivedFrom(ISpectrumData spec)
isDerivedFrom - Is this spectrum derived from the argument spectrum? (Recursively checks the whole chain of derivation if this derived spectrum is derived from yet another.)

Parameters:
spec - ISpectrumData
Returns:
boolean

equals

public boolean equals(java.lang.Object obj)
equals - Overrides equals to handle the special case in which the channel data and the SpecimenDesc are the same but the derived spectrum represents some modification of the original. Derived spectra are not considered equal to there base regardless.

Overrides:
equals in class BaseSpectrum
Parameters:
obj - Object
Returns:
boolean

isAlreadyDerivedFrom

public boolean isAlreadyDerivedFrom(java.lang.Class cls)
isAlreadyDerivedFrom - Sometimes it is a bad idea to derive a spectrum from a class from which it is already derived. An example would be the NormalizedSpectrum - Normalizing a spectrum twice is probably an error.

Parameters:
cls - Class
Returns:
boolean