@Override public void reset() throws IOException { m_structure = null; m_rowBuffer = null; if (m_dataDumper != null) { // close the unneeded temp files (if necessary) m_dataDumper.close(); m_dataDumper = null; } if (m_sourceReader != null) { m_sourceReader.close(); } if (m_File != null) { setFile(new File(m_File)); } }
@Override public void reset() throws IOException { m_structure = null; m_rowBuffer = null; if (m_dataDumper != null) { // close the unneeded temp files (if necessary) m_dataDumper.close(); m_dataDumper = null; } if (m_sourceReader != null) { m_sourceReader.close(); } if (m_File != null) { setFile(new File(m_File)); } }
/** * Method for testing the class from command line. * * @param args The supplied command line arguments. */ public static void main(String[] args) { if (args.length != 1) { System.err.println("Usage: CoverTree <ARFF file>"); System.exit(-1); } try { Instances insts = null; if (args[0].endsWith(".csv")) { CSVLoader csv = new CSVLoader(); csv.setFile(new File(args[0])); insts = csv.getDataSet(); } else { insts = new Instances(new BufferedReader(new FileReader(args[0]))); } CoverTree tree = new CoverTree(); tree.setInstances(insts); print("Created data tree:\n"); print(0, tree.m_Root); println(""); } catch (Exception ex) { ex.printStackTrace(); } } }
/** * Method for testing the class from command line. * * @param args The supplied command line arguments. */ public static void main(String[] args) { if (args.length != 1) { System.err.println("Usage: CoverTree <ARFF file>"); System.exit(-1); } try { Instances insts = null; if (args[0].endsWith(".csv")) { CSVLoader csv = new CSVLoader(); csv.setFile(new File(args[0])); insts = csv.getDataSet(); } else { insts = new Instances(new BufferedReader(new FileReader(args[0]))); } CoverTree tree = new CoverTree(); tree.setInstances(insts); print("Created data tree:\n"); print(0, tree.m_Root); println(""); } catch (Exception ex) { ex.printStackTrace(); } } }