@PublicAPI(stability=PRIVATE)

Package org.opends.server.util.table

Provides support for construction and display of tables in text based applications.

See:
          Description

Class Summary
CSVTablePrinter An interface for creating a CSV formatted table.
TableBuilder A class which can be used to construct tables of information to be displayed in a terminal.
TablePrinter An interface for incrementally configuring a table serializer.
TableSerializer An interface for serializing tables.
TabSeparatedTablePrinter An interface for creating a tab-separated formatted table.
TextTablePrinter An interface for creating a text based table.
 

Package org.opends.server.util.table Description

Provides support for construction and display of tables in text based applications. Applications construct tables using the TableBuilder class and display them using on of the TablePrinter implementations. At the moment two types of table output are supported:

The following code illustrates the construction of a text-based table:
 TableBuilder builder = new TableBuilder();

 builder.appendHeading("Name");
 builder.appendHeading("Age");
 builder.addSortKey(0);

 builder.startRow();
 builder.appendCell("Bob");
 builder.appendCell(11);

 builder.startRow();
 builder.appendCell("Alice");
 builder.appendCell(22);

 builder.startRow();
 builder.appendCell("Charlie");
 builder.appendCell(33);

 TextTablePrinter printer = new TextTablePrinter(System.out);
 printer.setColumnSeparator(":");
 builder.print(printer);
 
Which will display the following table:
 Name    : Age
 --------:----
 Alice   : 22
 Bob     : 11
 Charlie : 33