net.sf.nervalreports.generators.CSVSpanInfo Maven / Gradle / Ivy
/** This file is part of nervalreports.
*
* nervalreports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* nervalreports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with nervalreports. If not, see . */
package net.sf.nervalreports.generators;
/** Information about opened rowspans, for 'empty' (',') cell creation at CSV tables.
* @author farrer */
/* default */ class SpanInfo {
/** Number of rows to occupy with the current element span. */
/* default */ int rowSpan;
/** Number of collumns to occupy with the current element span. */
/* default */ int colSpan;
/** How much remainin lines to complete the needed rowspan for the element. */
/* default */ int remainingRows;
/** Default constructor. */
/* default */ SpanInfo(int rowSpan, int colSpan) {
this.rowSpan = rowSpan;
this.colSpan = colSpan;
this.remainingRows = rowSpan;
}
/** Decrement the number of remaining rows, verifying after if the rowspan is still active.
* @return true
if rowspan is still active (ie: have more remaining rows). */
boolean decRemainingRows() {
if (this.remainingRows > 0) {
this.remainingRows--;
}
return this.remainingRows > 0;
}
}