/** * Reads the data completely from the reader. The data can be accessed via * the <code>getData()</code> method. * * @param reader the reader to use * @throws IOException if something goes wrong * @see #getData() */ public ArffReader(Reader reader) throws IOException { m_retainStringValues = true; m_batchMode = true; m_Tokenizer = new StreamTokenizer(reader); initTokenizer(); readHeader(1000); initBuffers(); Instance inst; while ((inst = readInstance(m_Data)) != null) { m_Data.add(inst); } compactify(); }
/** * Reads the data completely from the reader. The data can be accessed via * the <code>getData()</code> method. * * @param reader the reader to use * @throws IOException if something goes wrong * @see #getData() */ public ArffReader(Reader reader) throws IOException { m_retainStringValues = true; m_batchMode = true; m_Tokenizer = new StreamTokenizer(reader); initTokenizer(); readHeader(1000); initBuffers(); Instance inst; while ((inst = readInstance(m_Data)) != null) { m_Data.add(inst); } compactify(); }
/** * Reads the data without header according to the specified template. The * data can be accessed via the <code>getData()</code> method. * * @param reader the reader to use * @param template the template header * @param lines the lines read so far * @param fieldSepAndEnclosures an optional array of Strings containing the * field separator and enclosures to use instead of the defaults. * The first entry in the array is expected to be the single * character field separator to use; the remaining entries (if any) * are enclosure characters to use. * @throws IOException if something goes wrong * @see #getData() */ public ArffReader(Reader reader, Instances template, int lines, String... fieldSepAndEnclosures) throws IOException { this(reader, template, lines, 100, true, fieldSepAndEnclosures); Instance inst; while ((inst = readInstance(m_Data)) != null) { m_Data.add(inst); } compactify(); }
/** * Reads the data without header according to the specified template. The * data can be accessed via the <code>getData()</code> method. * * @param reader the reader to use * @param template the template header * @param lines the lines read so far * @param fieldSepAndEnclosures an optional array of Strings containing the * field separator and enclosures to use instead of the defaults. * The first entry in the array is expected to be the single * character field separator to use; the remaining entries (if any) * are enclosure characters to use. * @throws IOException if something goes wrong * @see #getData() */ public ArffReader(Reader reader, Instances template, int lines, String... fieldSepAndEnclosures) throws IOException { this(reader, template, lines, 100, true, fieldSepAndEnclosures); Instance inst; while ((inst = readInstance(m_Data)) != null) { m_Data.add(inst); } compactify(); }