Class Table
- java.lang.Object
-
- org.dnsge.util.tableprinter.table.Table
-
public class Table extends java.lang.Object
Class 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 aDataSource
object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataSource
getDataSource()
Returns this Table'sDataSource
.char
getHorizontalSeparator()
Returns this Table's char that is used as a horizontal separator.char
getIntersectionChar()
Returns this Table's char that is used as an intersection character.TableAlignment
getTableAlignment()
Returns this Table'sTableAlignment
.TableHeader
getTableHeader()
Returns this Table'sTableHeader
.char
getVerticalSeparator()
Returns this Table's char that is used as a vertical separator.void
setHorizontalSeparator(char horizontalSeparator)
Sets this Table's char that is used as a horizontal separator.void
setIntersectionChar(char intersectionChar)
Sets this Table's char that is used as an intersection character.void
setTableAlignment(TableAlignment tableAlignment)
Sets this Table'sTableAlignment
.void
setUseIntersectionChar(boolean useIntersectionChar)
Sets whether this Table should use a specialized intersection character.void
setVerticalSeparator(char verticalSeparator)
Sets this Table's char that is used as a vertical separator.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).
-
-
-
Constructor Detail
-
Table
public Table(DataSource dataSource)
Creates a new Table from aDataSource
object- Parameters:
dataSource
-DataSource
object 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
-
-