gov.nist.microanalysis.EPQLibrary
Class BaseSpectrum

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

public abstract class BaseSpectrum
extends java.lang.Object
implements ISpectrumData

Implements a set of utility functions that are of use across the full set of ISpectrumData based classes.

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  int mHashCode
           
protected static int NULL_HASH
           
static BaseSpectrum NullSpectrum
          A null spectrum (no counts) for use as a benign error return in certain methods
 
Constructor Summary
protected BaseSpectrum()
           
 
Method Summary
 int compareTo(java.lang.Object object)
          compareTo - Keeping spectra in the order in which they were constructed.
 boolean equals(java.lang.Object obj)
          equals - Returns true if two spectra contain identical counts in each channel, the channel width & zero offset are equal and the SpectrumProperties are the same.
 int hashCode()
           
protected  void initializeSpectrumIndex()
           
 java.lang.String 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
getChannelCount, getChannelWidth, getCounts, getProperties, getZeroOffset
 

Field Detail

NULL_HASH

protected static final int NULL_HASH
See Also:
Constant Field Values

mHashCode

protected transient int mHashCode

NullSpectrum

public static final BaseSpectrum NullSpectrum
A null spectrum (no counts) for use as a benign error return in certain methods

Constructor Detail

BaseSpectrum

protected BaseSpectrum()
Method Detail

initializeSpectrumIndex

protected void initializeSpectrumIndex()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(java.lang.Object object)
compareTo - Keeping spectra in the order in which they were constructed.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - Object
Returns:
int

equals

public boolean equals(java.lang.Object obj)
equals - Returns true if two spectra contain identical counts in each channel, the channel width & zero offset are equal and the SpectrumProperties are the same. Note the two spectra may be instances of different classes derived from BaseSpectrum and yet satisfy the criteria for equality. (Equal != Identical)

Overrides:
equals in class java.lang.Object
Parameters:
obj - Object
Returns:
boolean