Class Table
- java.lang.Object
-
- org.dnsge.util.tableprinter.table.Table
-
public class Table extends java.lang.ObjectClass that represents a table that can be printed. Essentially a bean- Version:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description Table(DataSource dataSource)Creates a new Table from aDataSourceobject
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataSourcegetDataSource()Returns this Table'sDataSource.chargetHorizontalSeparator()Returns this Table's char that is used as a horizontal separator.chargetIntersectionChar()Returns this Table's char that is used as an intersection character.TableAlignmentgetTableAlignment()Returns this Table'sTableAlignment.TableHeadergetTableHeader()Returns this Table'sTableHeader.chargetVerticalSeparator()Returns this Table's char that is used as a vertical separator.voidsetHorizontalSeparator(char horizontalSeparator)Sets this Table's char that is used as a horizontal separator.voidsetIntersectionChar(char intersectionChar)Sets this Table's char that is used as an intersection character.voidsetTableAlignment(TableAlignment tableAlignment)Sets this Table'sTableAlignment.voidsetUseIntersectionChar(boolean useIntersectionChar)Sets whether this Table should use a specialized intersection character.voidsetVerticalSeparator(char verticalSeparator)Sets this Table's char that is used as a vertical separator.booleanuseIntersectionChar()Returns whether this Table should use a specialized intersection character (if true), or if the Table should use the regular horizontal separator (if false).
-
-
-
Constructor Detail
-
Table
public Table(DataSource dataSource)
Creates a new Table from aDataSourceobject- Parameters:
dataSource-DataSourceobject to use
-
-
Method Detail
-
getDataSource
public DataSource getDataSource()
Returns this Table'sDataSource.- Returns:
- This Table's
DataSource
-
getTableAlignment
public TableAlignment getTableAlignment()
Returns this Table'sTableAlignment.- Returns:
- This Table's
TableAlignment
-
setTableAlignment
public void setTableAlignment(TableAlignment tableAlignment)
Sets this Table'sTableAlignment.- Parameters:
tableAlignment- The newTableAlignment
-
getTableHeader
public TableHeader getTableHeader()
Returns this Table'sTableHeader.- Returns:
- This Table's
TableHeader
-
getHorizontalSeparator
public char getHorizontalSeparator()
Returns this Table's char that is used as a horizontal separator. Default is '─'.- Returns:
- This Table's horizontal separator
-
setHorizontalSeparator
public void setHorizontalSeparator(char horizontalSeparator)
Sets this Table's char that is used as a horizontal separator.- Parameters:
horizontalSeparator- This Table's new horizontal separator
-
getIntersectionChar
public char getIntersectionChar()
Returns this Table's char that is used as an intersection character. Default is '┼'.- Returns:
- This Table's intersection character
-
setIntersectionChar
public void setIntersectionChar(char intersectionChar)
Sets this Table's char that is used as an intersection character.- Parameters:
intersectionChar- This Table's new intersection character
-
useIntersectionChar
public boolean useIntersectionChar()
Returns whether this Table should use a specialized intersection character (if true), or if the Table should use the regular horizontal separator (if false).- Returns:
- Whether this Table should use a specialized intersection character
-
setUseIntersectionChar
public void setUseIntersectionChar(boolean useIntersectionChar)
Sets whether this Table should use a specialized intersection character.- Parameters:
useIntersectionChar- Whether this Table should use a specialized intersection character- See Also:
useIntersectionChar()
-
getVerticalSeparator
public char getVerticalSeparator()
Returns this Table's char that is used as a vertical separator. Default is '│'.- Returns:
- This Table's horizontal separator
-
setVerticalSeparator
public void setVerticalSeparator(char verticalSeparator)
Sets this Table's char that is used as a vertical separator.- Parameters:
verticalSeparator- This Table's new vertical separator
-
-