/** * Determines and returns (if possible) the structure (internally the * header) of the data set as an empty set of instances. * * @return the structure of the data set as an empty set * of Instances * @throws IOException if an error occurs */ public Instances getStructure() throws IOException { if (m_sourceReader == null) throw new IOException("No source has been specified"); if (m_structure == null) { try { m_XMLInstances = new XMLInstances(m_sourceReader); m_structure = new Instances(m_XMLInstances.getInstances(), 0); } catch (IOException ioe) { // just re-throw it throw ioe; } catch (Exception e) { throw new RuntimeException(e); } } return new Instances(m_structure, 0); }
/** * Resets the Saver */ @Override public void resetOptions() { super.resetOptions(); if (getCompressOutput()) { setFileExtension(XRFFLoader.FILE_EXTENSION_COMPRESSED); } else { setFileExtension(XRFFLoader.FILE_EXTENSION); } try { m_XMLInstances = new XMLInstances(); } catch (Exception e) { m_XMLInstances = null; } }
/** * Resets the Saver */ public void resetOptions() { super.resetOptions(); if (getCompressOutput()) setFileExtension(XRFFLoader.FILE_EXTENSION_COMPRESSED); else setFileExtension(XRFFLoader.FILE_EXTENSION); try { m_XMLInstances = new XMLInstances(); } catch (Exception e) { m_XMLInstances = null; } }