public class CWC_LongestWordMin extends Object implements AT_ColumnWidthCalculator
Calculates the width of table columns using the longest word in a column with minimum column width settings.
| Modifier and Type | Field and Description |
|---|---|
protected int |
min
The minimum width of all columns.
|
protected int[] |
minAr
The minimum width per individual column.
|
| Constructor and Description |
|---|
CWC_LongestWordMin(int min)
Creates a new width object.
|
CWC_LongestWordMin(int[] minAr)
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 min
The minimum width of all columns.
protected int[] minAr
The minimum width per individual column.
public CWC_LongestWordMin(int min)
Creates a new width object.
min - the minimum width of each column, cannot be smaller than 3IllegalArgumentException - if the parameter was less than 3public CWC_LongestWordMin(int[] minAr)
Creates a new width object
minAr - the minimum 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.