Package adams.db

Class SpectrumIterator

    • Field Detail

      • m_Spectrum

        protected SpectrumIntf m_Spectrum
        the underlying spectrum DB handler.
      • m_SampleData

        protected SampleDataIntf m_SampleData
        the underlying sampledata DB handler.
      • m_ResultSet

        protected ResultSet m_ResultSet
        the underlying resultset.
      • m_Next

        protected Spectrum m_Next
        the next spectrum.
      • m_Connection

        protected Connection m_Connection
        the connection to close.
      • m_Size

        protected int m_Size
        the number of rows in the resultset.
    • Constructor Detail

      • SpectrumIterator

        public SpectrumIterator​(SpectrumIntf spectrum,
                                SampleDataIntf sampleData,
                                ResultSet resultSet,
                                Connection connection)
        Initializes the iterator.
        Parameters:
        spectrum - the spectrum handler
        sampleData - the sampledata handler
        resultSet - the result set to iterate
        connection - the connection to close after finished reading, if any
    • Method Detail

      • getSize

        public int getSize()
        Returns the number of rows.
        Returns:
        the rows
      • hasNext

        public boolean hasNext()
        Returns true if the iteration has more elements. (In other words, returns true if next() would return an element rather than throwing an exception.)
        Specified by:
        hasNext in interface Iterator<Spectrum>
        Returns:
        true if the iteration has more elements