franta-hg@88: /**
franta-hg@88: * SQL-DK
franta-hg@88: * Copyright © 2013 František Kučera (frantovo.cz)
franta-hg@88: *
franta-hg@88: * This program is free software: you can redistribute it and/or modify
franta-hg@88: * it under the terms of the GNU General Public License as published by
franta-hg@88: * the Free Software Foundation, either version 3 of the License, or
franta-hg@88: * (at your option) any later version.
franta-hg@88: *
franta-hg@88: * This program is distributed in the hope that it will be useful,
franta-hg@88: * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@88: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@88: * GNU General Public License for more details.
franta-hg@88: *
franta-hg@88: * You should have received a copy of the GNU General Public License
franta-hg@88: * along with this program. If not, see .
franta-hg@88: */
franta-hg@88: package info.globalcode.sql.dk.formatting;
franta-hg@88:
franta-hg@88: import java.util.ArrayList;
franta-hg@88: import java.util.List;
franta-hg@88:
franta-hg@88: /**
franta-hg@88: * Prefetches whole result set and computes column widths. Whole table is flushed at once in
franta-hg@88: * {@linkplain #writeEndResultSet()}.
franta-hg@88: *
franta-hg@88: * Long values will not overflow the cells, but whole result set must be loaded into memory.
franta-hg@88: *
franta-hg@88: * @author Ing. František Kučera (frantovo.cz)
franta-hg@88: */
franta-hg@88: public class TabularPrefetchingFormatter extends TabularFormatter {
franta-hg@88:
franta-hg@88: public static final String NAME = "tabular-prefetching"; // bash-completion:formatter
franta-hg@88: private ColumnsHeader currentHeader;
franta-hg@88: private List