Class TypeRangeIterator

  • All Implemented Interfaces:
    Iterator<CellLocation>

    public class TypeRangeIterator
    extends Object
    implements Iterator<CellLocation>
    Iterates over a range of cells, looking for a type of cell.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Field Detail

      • m_Sheet

        protected SpreadSheet m_Sheet
        the spreadsheet to process.
      • m_SheetRow

        protected Row m_SheetRow
        the row to process.
      • m_Rows

        protected int[] m_Rows
        the row indices.
      • m_Columns

        protected int[] m_Columns
        the column indices.
      • m_Row

        protected int m_Row
        the current row (index).
      • m_Column

        protected int m_Column
        the current column (index).
      • m_Finished

        protected boolean m_Finished
        whether we finished searching.
      • m_Next

        protected int[] m_Next
        the next location.
    • Constructor Detail

      • TypeRangeIterator

        public TypeRangeIterator​(SpreadSheet sheet,
                                 Cell.ContentType type,
                                 int[] rows,
                                 int[] cols)
        Initializes the iterator.
        Parameters:
        sheet - the sheet to use
        type - the content type
        rows - the row indices of the range
        cols - the column indices of the range
      • TypeRangeIterator

        public TypeRangeIterator​(Row sheetRow,
                                 Cell.ContentType type,
                                 int[] cols)
        Initializes the iterator.
        Parameters:
        sheetRow - the row to use
        type - the content type
        cols - the column indices of the range
    • Method Detail

      • findNext

        protected void findNext()
        Find the next location.
      • hasNext

        public boolean hasNext()
        Returns whether another cell location is available.
        Specified by:
        hasNext in interface Iterator<CellLocation>
        Returns:
        true if another is available