org.omnaest.utils.structure.table.helper
Class TableHelper

java.lang.Object
  extended by org.omnaest.utils.structure.table.helper.TableHelper

public class TableHelper
extends Object

Helper class offering several methods for Table

Author:
Omnaest

Constructor Summary
TableHelper()
           
 
Method Summary
protected static List<Integer> determineIndexPositionList(int[] indexPositions)
          Converts a array of given index positions into a sorted list.
static Table<String> parseCSVContent(String content)
          Returns a table for a given csv text content.
static Table<String> parseCSVContent(String content, String columnSeparator)
          Returns a table for a given csv text content using the given column separator.
static
<E> String
renderAsCSVContent(Table<E> table)
           
static
<E> String
renderAsCSVContent(Table<E> table, String columnSeparator)
          Renders the content of a table as csv text using the given column separator.
static
<E> String
renderToString(Table<E> table)
          Converts a given Table to a readable String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableHelper

public TableHelper()
Method Detail

determineIndexPositionList

protected static List<Integer> determineIndexPositionList(int[] indexPositions)
Converts a array of given index positions into a sorted list.

Parameters:
indexPositions -
Returns:

parseCSVContent

public static Table<String> parseCSVContent(String content)
Returns a table for a given csv text content.

Parameters:
content -
Returns:
See Also:
parseCSVContent(String, String)

parseCSVContent

public static Table<String> parseCSVContent(String content,
                                            String columnSeparator)
Returns a table for a given csv text content using the given column separator.

Parameters:
content -
columnSeparator -
Returns:
See Also:
parseCSVContent(String, String)

renderAsCSVContent

public static <E> String renderAsCSVContent(Table<E> table)
Type Parameters:
E -
Parameters:
table -
Returns:
See Also:
renderAsCSVContent(Table, String)

renderAsCSVContent

public static <E> String renderAsCSVContent(Table<E> table,
                                            String columnSeparator)
Renders the content of a table as csv text using the given column separator.

Parameters:
columnSeparator -
table -
Returns:
See Also:
renderAsCSVContent(Table)

renderToString

public static <E> String renderToString(Table<E> table)
Converts a given Table to a readable String

Parameters:
table -
Returns:


Copyright © 2011. All Rights Reserved.