org.camunda.bpm.extension.osgi.commands.asciitable
Class SimpleASCIITableImpl

java.lang.Object
  extended by org.camunda.bpm.extension.osgi.commands.asciitable.SimpleASCIITableImpl
All Implemented Interfaces:
IASCIITable

public class SimpleASCIITableImpl
extends Object
implements IASCIITable

This implementation builds the header and data rows by considering each column one by one in the format of 'FFFF...' (border format). While rendering the last column, it closes the table. It takes +3 characters to render each column. These three characters include two white spaces at left and right side of the max length string in the column and one char(|) for table formatting.

Version:
1.0
Author:
K Venkata Sudhakar (kvenkatasudhakar@gmail.com)

Field Summary
 
Fields inherited from interface org.camunda.bpm.extension.osgi.commands.asciitable.IASCIITable
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, DEFAULT_DATA_ALIGN, DEFAULT_HEADER_ALIGN
 
Constructor Summary
SimpleASCIITableImpl()
           
 
Method Summary
 String getTable(ASCIITableHeader[] headerObjs, String[][] data)
           
 String getTable(IASCIITableAware asciiTableAware)
           
 String getTable(String[] header, int headerAlign, String[][] data, int dataAlign)
           
 String getTable(String[] header, String[][] data)
          Returns the ASCII table as string which can be rendered in console or JSP.
 String getTable(String[] header, String[][] data, int dataAlign)
           
 void printTable(ASCIITableHeader[] headerObjs, String[][] data)
           
 void printTable(IASCIITableAware asciiTableAware)
           
 void printTable(String[] header, int headerAlign, String[][] data, int dataAlign)
           
 void printTable(String[] header, String[][] data)
          Prints the ASCII table to console.
 void printTable(String[] header, String[][] data, int dataAlign)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleASCIITableImpl

public SimpleASCIITableImpl()
Method Detail

printTable

public void printTable(String[] header,
                       String[][] data)
Description copied from interface: IASCIITable
Prints the ASCII table to console.

Specified by:
printTable in interface IASCIITable

printTable

public void printTable(String[] header,
                       String[][] data,
                       int dataAlign)
Specified by:
printTable in interface IASCIITable

printTable

public void printTable(String[] header,
                       int headerAlign,
                       String[][] data,
                       int dataAlign)
Specified by:
printTable in interface IASCIITable

getTable

public String getTable(String[] header,
                       String[][] data)
Description copied from interface: IASCIITable
Returns the ASCII table as string which can be rendered in console or JSP.

Specified by:
getTable in interface IASCIITable
Returns:

getTable

public String getTable(String[] header,
                       String[][] data,
                       int dataAlign)
Specified by:
getTable in interface IASCIITable

getTable

public String getTable(String[] header,
                       int headerAlign,
                       String[][] data,
                       int dataAlign)
Specified by:
getTable in interface IASCIITable

printTable

public void printTable(ASCIITableHeader[] headerObjs,
                       String[][] data)
Specified by:
printTable in interface IASCIITable

getTable

public String getTable(IASCIITableAware asciiTableAware)
Specified by:
getTable in interface IASCIITable

printTable

public void printTable(IASCIITableAware asciiTableAware)
Specified by:
printTable in interface IASCIITable

getTable

public String getTable(ASCIITableHeader[] headerObjs,
                       String[][] data)
Specified by:
getTable in interface IASCIITable


Copyright © 2015 camunda services GmbH. All rights reserved.