/** * Returns the current column value for a given column header name. * * @param headerName * The header name of the column. * @return The current column value. * @exception IOException * Thrown if this object has already been closed. */ public String get(String headerName) throws IOException { checkClosed(); return get(getIndex(headerName)); }
/** * Read the first record of data as column headers. * * @return Whether the header record was successfully read or not. * @exception IOException * Thrown if an error occurs while reading data from the * source stream. */ public boolean readHeaders() throws IOException { boolean result = readRecord(); // copy the header data from the column array // to the header string array headersHolder.Length = columnsCount; headersHolder.Headers = new String[columnsCount]; for (int i = 0; i < headersHolder.Length; i++) { String columnValue = get(i); headersHolder.Headers[i] = columnValue; // if there are duplicate header names, we will save the last one headersHolder.IndexByName.put(columnValue, new Integer(i)); } if (result) { currentRecord--; } columnsCount = 0; return result; }