Class Row

    • Field Detail

      • flagged

        public final boolean flagged
      • starred

        public final boolean starred
      • cells

        public final<Cell> cells
    • Constructor Detail

      • Row

        public Row​(List<Cell> cells)
        Construct a new Row containing the given cells.
      • Row

        public Row​(List<Cell> cells,
                   boolean flagged,
                   boolean starred)
      • Row

        public Row​(int nbCells)
      • Row

        protected Row​(<Cell> cells,
                      boolean flagged,
                      boolean starred)
    • Method Detail

      • isEmpty

        public boolean isEmpty()
      • getCell

        public Cell getCell​(int cellIndex)
        cellIndex - index of cell to return
        given cell or null if cell doesn't exist or cell index is out of range
      • getCellValue

        public Serializable getCellValue​(int cellIndex)
      • isCellBlank

        public boolean isCellBlank​(int cellIndex)
        Whether the cell at the given index is null or consists only of whitespace.
      • isCellPending

        public boolean isCellPending​(int cellIndex)
        Whether the cell at the given index is being computed and should not be treated as a definitive value.
      • isValueBlank

        protected boolean isValueBlank​(Object value)
      • isFlagged

        public boolean isFlagged()
      • isStarred

        public boolean isStarred()
      • getCells

        public List<Cell> getCells()
      • withCell

        public Row withCell​(int index,
                            Cell cell)
        Overwrite a cell at a given index. As rows are immutable this returns a new row.
        index - the position of the cell to overwrite
        cell - the cell value
        the modified row
      • insertCell

        public Row insertCell​(int index,
                              Cell cell)
        Inserts a cell at a given index. As rows are immutable this returns a new row.
        index - the position where to insert the cell
        cell - the cell to insert
        the new row
      • insertCells

        public Row insertCells​(int index,
                               List<Cell> cells)
        Insest multiple cells contiguously, starting at a given index
        index - the index of the first inserted cell
        cells - the cells to insert
      • removeCell

        public Row removeCell​(int index)
        Removes a cell from the row (removing the corresponding column).
        index - the index of the cell to remove
        the new row without the cell
      • withFlagged

        public Row withFlagged​(boolean newFlagged)
        Changes the flag on the row.
      • withStarred

        public Row withStarred​(boolean newStarred)
        Changes the star on the row.
      • padWithNull

        public Row padWithNull​(int finalSize)
        Returns a copy of this row with null cells added at the end, such that the new row has the supplied size.
        finalSize - the size of the returned row