public class CWC_LongestWordMax extends Object implements AT_ColumnWidthCalculator
Calculates the width of table columns using the longest word in a column with maximum column width settings.
| Modifier and Type | Field and Description |
|---|---|
protected int |
max
The maximum width of all columns.
|
protected int[] |
maxAr
The maximum width per individual column.
|
| Constructor and Description |
|---|
CWC_LongestWordMax(int max)
Creates a new width object.
|
CWC_LongestWordMax(int[] maxAr)
Creates a new width object.
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
calculateColumnWidths(LinkedList<AT_Row> rows,
int colNumbers,
int tableWidth)
Returns the width of each column in an array, column one being [0] and so on.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcalculateColumnWidthsprotected int max
The maximum width of all columns.
protected int[] maxAr
The maximum width per individual column.
public CWC_LongestWordMax(int max)
Creates a new width object.
max - the maximum width of each column, cannot be smaller than 3IllegalArgumentException - if the parameter was less than 3public CWC_LongestWordMax(int[] maxAr)
Creates a new width object.
maxAr - the maximum width per individual column, entries of -1 will be ignored and the longest word being usedIllegalArgumentException - if the array had width of less than 3 or was nullpublic int[] calculateColumnWidths(LinkedList<AT_Row> rows, int colNumbers, int tableWidth)
AT_ColumnWidthCalculatorReturns the width of each column in an array, column one being [0] and so on.
calculateColumnWidths in interface AT_ColumnWidthCalculatorrows - the table rows with rules and contentcolNumbers - number of columns in the tabletableWidth - required overall table widthCopyright © 2014–2017. All rights reserved.