com.snowtide.pdf.util
Class TableUtils

java.lang.Object
  extended by com.snowtide.pdf.util.TableUtils

public class TableUtils
extends java.lang.Object

This class provides a set of utility functions related to working with Tables. At the moment, only CSV conversion functions are provided.

Version:
©2004-2012 Snowtide Informatics Systems, Inc.

Method Summary
static java.lang.String[] convertTablesToCSV(Page p, char delim)
          Calls convertTablesToCSV(Page, char, String) with the specified page, cell delimiter, and a single linefeed (\n) as a linebreak sequence.
static java.lang.String[] convertTablesToCSV(Page p, char delim, java.lang.String linebreak)
          Returns an array of CSV-formatted Strings, one for each Table found in the given page, using the specified character as a cell delimiter and the specified String as a linebreak sequence.
static java.lang.String convertToCSV(Table table, char delim)
          Calls convertToCSV(Table, char, String) with the specified Table, cell delimiter, and a single linefeed (\n) as a linebreak sequence.
static java.lang.String convertToCSV(Table table, char delim, java.lang.String linebreak)
          Returns a CSV-formatted String based on the contents of the given Table, using the specified character as a cell delimiter and the specified String as a linebreak sequence.
static java.util.List getAllTables(Page p)
          Returns a List of Table instances that are available in the given Page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convertToCSV

public static java.lang.String convertToCSV(Table table,
                                            char delim)
                                     throws java.io.IOException
Calls convertToCSV(Table, char, String) with the specified Table, cell delimiter, and a single linefeed (\n) as a linebreak sequence.

Throws:
java.io.IOException
See Also:
convertToCSV(Table, char, String)

convertToCSV

public static java.lang.String convertToCSV(Table table,
                                            char delim,
                                            java.lang.String linebreak)
                                     throws java.io.IOException
Returns a CSV-formatted String based on the contents of the given Table, using the specified character as a cell delimiter and the specified String as a linebreak sequence.

Throws:
java.io.IOException - if an error occurs generating the CSV conversion

convertTablesToCSV

public static java.lang.String[] convertTablesToCSV(Page p,
                                                    char delim,
                                                    java.lang.String linebreak)
                                             throws java.io.IOException
Returns an array of CSV-formatted Strings, one for each Table found in the given page, using the specified character as a cell delimiter and the specified String as a linebreak sequence. This is simply a shortcut to applying convertToCSV(Table, char, String) to each Table in the given Page manually.

Throws:
java.io.IOException - if an error occurs generating the CSV conversion
See Also:
convertToCSV(Table, char, String)

convertTablesToCSV

public static java.lang.String[] convertTablesToCSV(Page p,
                                                    char delim)
                                             throws java.io.IOException
Calls convertTablesToCSV(Page, char, String) with the specified page, cell delimiter, and a single linefeed (\n) as a linebreak sequence.

Throws:
java.io.IOException

getAllTables

public static java.util.List getAllTables(Page p)
Returns a List of Table instances that are available in the given Page.