Class MultiSpectrum

  • All Implemented Interfaces:
    adams.core.CloneHandler, adams.core.Mergeable<adams.data.container.DataContainer>, adams.core.UniqueIDHandler, adams.data.container.DataContainer<Spectrum>, adams.data.container.DataPoint, adams.data.id.IDHandler, adams.data.id.MutableIDHandler, adams.data.NotesHandler, adams.data.report.MutableReportHandler<SampleData>, adams.data.report.ReportHandler<SampleData>, Serializable, Comparable, Iterable<Spectrum>, Collection<Spectrum>

    public class MultiSpectrum
    extends adams.data.container.AbstractDataContainer<Spectrum>
    implements adams.data.container.DataPoint, adams.data.report.MutableReportHandler<SampleData>, adams.data.NotesHandler
    For storing multiple spectra.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static adams.data.container.DataPointComparator<Spectrum> m_Comparator
      the default comparator.
      protected AbstractSpectrumComparator m_CustomComparator
      a custom comparator.
      protected adams.data.Notes m_Notes
      the notes for the chromatogram.
      protected adams.data.container.DataContainer m_Parent
      the parent.
      protected SampleData m_SampleData
      the report.
      • Fields inherited from class adams.data.container.AbstractDataContainer

        m_ID, m_Points, m_UUID
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiSpectrum()
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void assign​(adams.data.container.DataContainer<Spectrum> other)
      Obtains the stored variables from the other data point, but not the actual data points.
      void assign​(adams.data.container.DataPoint other)
      Obtains the stored variables from the other data point.
      adams.data.container.DataPointComparator<Spectrum> getComparator()
      Returns the comparator in use (custom one if defined, otherwise the default one).
      AbstractSpectrumComparator getCustomComparator()
      Returns the custom comparaor in use.
      adams.data.Notes getNotes()
      Returns the currently stored notes.
      adams.data.container.DataContainer getParent()
      Returns the container this point belongs to.
      SampleData getReport()
      get sample data.
      boolean hasParent()
      Returns whether the point belongs to a container.
      boolean hasReport()
      Returns whether sample data is present.
      adams.data.container.DataPointComparator<Spectrum> newComparator()
      Returns a new instance of the default comparator.
      Spectrum newPoint()
      Returns a new instance of a DataContainer point.
      void setCustomComparator​(AbstractSpectrumComparator value)
      Sets the custom comparator to use.
      void setParent​(adams.data.container.DataContainer value)
      Sets the container this point belongs to.
      void setReport​(SampleData value)
      Set sample data.
      String toString()
      Returns a string representation of the sequence.
      • Methods inherited from class adams.data.container.AbstractDataContainer

        add, addAll, clear, compareTo, compareToData, compareToHeader, contains, containsAll, ensureCapacity, equals, equalsData, equalsHeader, getClone, getHeader, getID, getUniqueID, hashCode, isEmpty, iterator, mergeWith, modifiedListener, newInstance, remove, removeAll, retainAll, setID, size, toArray, toArray, toList, toList, toTreeSet, toTreeSet, trimToSize
      • Methods inherited from interface adams.data.container.DataPoint

        getClone
    • Field Detail

      • m_SampleData

        protected SampleData m_SampleData
        the report.
      • m_Comparator

        protected static adams.data.container.DataPointComparator<Spectrum> m_Comparator
        the default comparator.
      • m_Parent

        protected adams.data.container.DataContainer m_Parent
        the parent.
      • m_Notes

        protected adams.data.Notes m_Notes
        the notes for the chromatogram.
    • Constructor Detail

      • MultiSpectrum

        public MultiSpectrum()
        Default constructor.
    • Method Detail

      • newComparator

        public adams.data.container.DataPointComparator<Spectrum> newComparator()
        Returns a new instance of the default comparator.
        Specified by:
        newComparator in interface adams.data.container.DataContainer<Spectrum>
        Returns:
        the comparator instance
      • getComparator

        public adams.data.container.DataPointComparator<Spectrum> getComparator()
        Returns the comparator in use (custom one if defined, otherwise the default one).
        Specified by:
        getComparator in interface adams.data.container.DataContainer<Spectrum>
        Returns:
        the comparator in use
      • setCustomComparator

        public void setCustomComparator​(AbstractSpectrumComparator value)
        Sets the custom comparator to use.
        Parameters:
        value - the comparator to use, null to unset
      • getCustomComparator

        public AbstractSpectrumComparator getCustomComparator()
        Returns the custom comparaor in use.
        Returns:
        the custom comparator, null if none set
      • setParent

        public void setParent​(adams.data.container.DataContainer value)
        Sets the container this point belongs to.
        Specified by:
        setParent in interface adams.data.container.DataPoint
        Parameters:
        value - the container
      • getParent

        public adams.data.container.DataContainer getParent()
        Returns the container this point belongs to.
        Specified by:
        getParent in interface adams.data.container.DataPoint
        Returns:
        the container, can be null
      • hasParent

        public boolean hasParent()
        Returns whether the point belongs to a container.
        Specified by:
        hasParent in interface adams.data.container.DataPoint
        Returns:
        true if the point belongs to a container
      • assign

        public void assign​(adams.data.container.DataPoint other)
        Obtains the stored variables from the other data point.
        Specified by:
        assign in interface adams.data.container.DataPoint
        Parameters:
        other - the data point to get the values from
      • assign

        public void assign​(adams.data.container.DataContainer<Spectrum> other)
        Obtains the stored variables from the other data point, but not the actual data points.
        Specified by:
        assign in interface adams.data.container.DataContainer<Spectrum>
        Overrides:
        assign in class adams.data.container.AbstractDataContainer<Spectrum>
        Parameters:
        other - the data point to get the values from
      • newPoint

        public Spectrum newPoint()
        Returns a new instance of a DataContainer point.
        Specified by:
        newPoint in interface adams.data.container.DataContainer<Spectrum>
        Returns:
        the new DataContainer point
      • hasReport

        public boolean hasReport()
        Returns whether sample data is present.
        Specified by:
        hasReport in interface adams.data.report.ReportHandler<SampleData>
        Returns:
        true if sample data present
      • setReport

        public void setReport​(SampleData value)
        Set sample data. Also sets the database ID and sample ID in the sample data (without "'").
        Specified by:
        setReport in interface adams.data.report.MutableReportHandler<SampleData>
        Parameters:
        value - the sample data
      • getReport

        public SampleData getReport()
        get sample data.
        Specified by:
        getReport in interface adams.data.report.ReportHandler<SampleData>
        Returns:
        the sample data
      • getNotes

        public adams.data.Notes getNotes()
        Returns the currently stored notes.
        Specified by:
        getNotes in interface adams.data.NotesHandler
        Returns:
        the current notes
      • toString

        public String toString()
        Returns a string representation of the sequence.
        Overrides:
        toString in class adams.data.container.AbstractDataContainer<Spectrum>
        Returns:
        the string representation