Package org.orbisgis.commons.printer
Class CustomPrinter
- java.lang.Object
-
- org.orbisgis.commons.printer.CustomPrinter
-
- All Implemented Interfaces:
ICustomPrinter
public abstract class CustomPrinter extends Object implements ICustomPrinter
Root implementation ofICustomPrinterfor the custom printers.- Author:
- Erwan Bocher (CNRS), Sylvain PALOMINOS (UBS 2019-2020)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.orbisgis.commons.printer.ICustomPrinter
ICustomPrinter.CellPosition
-
-
Field Summary
Fields Modifier and Type Field Description protected StringBuilderbuilderNot nullStringBuilderused for the string buildingprotected intcolumnCountCount of columnprotected intcolumnIndexCurrent column indexprotected intcolumnWidthWidth in character number of a single columnprotected booleanisDrawingTableTrue of a table is currently drawn, false otherwise
-
Constructor Summary
Constructors Modifier Constructor Description protectedCustomPrinter(StringBuilder builder)Main constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendTableValue(Object value)Add a single value to the table.voidappendText(String text)voidendTable()End the table drawing.voidstartTable(int columnWidth, int columnCount)Start the drawing of a table.StringtoString()Return the not null string representation of the data contained by theICustomPrinterin its specific format.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.orbisgis.commons.printer.ICustomPrinter
appendTableHeaderValue, appendTableLineSeparator, appendTableTitle, appendTableValue, appendValue
-
-
-
-
Field Detail
-
builder
protected StringBuilder builder
Not nullStringBuilderused for the string building
-
columnWidth
protected int columnWidth
Width in character number of a single column
-
columnCount
protected int columnCount
Count of column
-
isDrawingTable
protected boolean isDrawingTable
True of a table is currently drawn, false otherwise
-
columnIndex
protected int columnIndex
Current column index
-
-
Constructor Detail
-
CustomPrinter
protected CustomPrinter(StringBuilder builder)
Main constructor.- Parameters:
builder-StringBuilderused for the string building.
-
-
Method Detail
-
toString
public String toString()
Description copied from interface:ICustomPrinterReturn the not null string representation of the data contained by theICustomPrinterin its specific format.- Specified by:
toStringin interfaceICustomPrinter- Overrides:
toStringin classObject- Returns:
- The not null string representation of the data contained by the
ICustomPrinter
-
startTable
public void startTable(int columnWidth, int columnCount)Description copied from interface:ICustomPrinterStart the drawing of a table.- Specified by:
startTablein interfaceICustomPrinter- Parameters:
columnWidth- Width in character number of a single column.columnCount- Count of column.
-
endTable
public void endTable()
Description copied from interface:ICustomPrinterEnd the table drawing.- Specified by:
endTablein interfaceICustomPrinter
-
appendTableValue
public void appendTableValue(Object value)
Description copied from interface:ICustomPrinterAdd a single value to the table. Linebreak are automatically generated once the column count is reached.- Specified by:
appendTableValuein interfaceICustomPrinter- Parameters:
value- Value to add to the table.
-
appendText
public void appendText(String text)
- Specified by:
appendTextin interfaceICustomPrinter
-
-