Class FindCellsIterator

    • Field Detail

      • m_SpreadSheet

        protected SpreadSheet m_SpreadSheet
        the spreadsheet to search.
      • m_Row

        protected int m_Row
        the current row index.
      • m_Column

        protected int m_Column
        the current column index.
      • m_Next

        protected Cell m_Next
        the next cell.
      • m_Stopped

        protected boolean m_Stopped
        whether the search was stopped.
    • Constructor Detail

      • FindCellsIterator

        public FindCellsIterator​(SpreadSheet spreadSheet,
                                 FindCellsParameters parameters)
        Initializes the iterator.
        Parameters:
        spreadSheet - the spreadsheet to search
        parameters - the search parameters
    • Method Detail

      • getSpreadSheet

        public SpreadSheet getSpreadSheet()
        Returns the spreadsheet that is being searched.
        Returns:
        the spreadsheet
      • getParameters

        public FindCellsParameters getParameters()
        Returns the search string.
        Returns:
        the search string
      • nextCell

        protected Cell nextCell()
        Moves to the next cell.
        Returns:
        the next cell to inspect, null if no more cells
      • isMatch

        protected boolean isMatch​(Cell cell)
        Checks whether the cell is matching the criteria.
        Parameters:
        cell - the cell to check
        Returns:
        true if a match
      • 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<Cell>
        Returns:
        true if the iteration has more elements
      • next

        public Cell next()
        Returns the next element in the iteration.
        Specified by:
        next in interface Iterator<Cell>
        Returns:
        the next element in the iteration
        Throws:
        NoSuchElementException - if the iteration has no more elements
      • stopExecution

        public void stopExecution()
        Stops the execution.
        Specified by:
        stopExecution in interface Stoppable
      • isStopped

        public boolean isStopped()
        Whether the execution has been stopped.
        Specified by:
        isStopped in interface StoppableWithFeedback
        Returns:
        true if stopped