java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularWrappingFormatter.java
branchv_0
changeset 142 da1e38386d84
parent 123 248a98c13ca4
child 155 eb3676c6929b
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularWrappingFormatter.java	Tue Jan 07 21:53:24 2014 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularWrappingFormatter.java	Tue Jan 07 21:54:59 2014 +0100
     1.3 @@ -38,8 +38,8 @@
     1.4  	}
     1.5  
     1.6  	@Override
     1.7 -	public void writeColumnsHeader(ColumnsHeader header) {
     1.8 -		super.writeColumnsHeader(header);
     1.9 +	public void writeStartResultSet(ColumnsHeader header) {
    1.10 +		super.writeStartResultSet(header);
    1.11  		currentRow = new ArrayList<>(header.getColumnCount());
    1.12  	}
    1.13  
    1.14 @@ -48,7 +48,7 @@
    1.15  		boolean rightAlign = value instanceof Number || value instanceof Boolean;
    1.16  		String valueString = String.valueOf(value);
    1.17  		int columnWidth = getColumnWidth(getCurrentColumnsCount()) - 1;  // -1 = space for new line symbol
    1.18 -		currentRow.add(split(valueString, columnWidth, rightAlign));
    1.19 +		currentRow.add(wrapLines(valueString, columnWidth, rightAlign));
    1.20  	}
    1.21  
    1.22  	@Override
    1.23 @@ -99,7 +99,7 @@
    1.24  		// already done – wrapped row ends
    1.25  	}
    1.26  
    1.27 -	private static String[] split(String s, int width, boolean rightAlign) {
    1.28 +	private static String[] wrapLines(String s, int width, boolean rightAlign) {
    1.29  		String[] array = new String[(s.length() - 1) / width + 1];
    1.30  		for (int i = 0; i < array.length; i++) {
    1.31  			if (i == array.length - 1) {