Class Row

    • Field Detail

      • flagged

        public final boolean flagged
      • starred

        public final boolean starred
      • cells

        public final com.google.common.collect.ImmutableList<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​(com.google.common.collect.ImmutableList<Cell> cells,
                      boolean flagged,
                      boolean starred)
    • Method Detail

      • isEmpty

        public boolean isEmpty()
      • getCell

        public Cell getCell​(int cellIndex)
        Parameters:
        cellIndex - index of cell to return
        Returns:
        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.
        Parameters:
        index - the position of the cell to overwrite
        cell - the cell value
        Returns:
        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.
        Parameters:
        index - the position where to insert the cell
        cell - the cell to insert
        Returns:
        the new row
      • insertCells

        public Row insertCells​(int index,
                               List<Cell> cells)
        Insest multiple cells contiguously, starting at a given index
        Parameters:
        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).
        Parameters:
        index - the index of the cell to remove
        Returns:
        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.
        Parameters:
        finalSize - the size of the returned row