/** * Signify that this batch of input to the filter is finished. * * @return true if there are instances pending output * @throws NullPointerException if no input structure has been defined, * @throws Exception if there was a problem finishing the batch. */ @Override public boolean batchFinished() throws Exception { if (getInputFormat() == null) { throw new NullPointerException("No input instance format defined"); } Instances insts = getInputFormat(); if (m_useReplaceMissing) { insts = Filter.useFilter(insts, m_replaceMissing); } insts = Filter.useFilter(insts, m_ntob); if (!m_OutputFormatDefined) { setOutputFormat(); } for (Instance instance : insts) { push(convertInstance(instance), false); // No need to copy } flushInput(); m_NewBatch = true; m_FirstBatchDone = true; return (numPendingOutput() != 0); }
/** * Signify that this batch of input to the filter is finished. * * @return true if there are instances pending output * @throws NullPointerException if no input structure has been defined, * @throws Exception if there was a problem finishing the batch. */ @Override public boolean batchFinished() throws Exception { if (getInputFormat() == null) { throw new NullPointerException("No input instance format defined"); } Instances insts = getInputFormat(); if (m_useReplaceMissing) { insts = Filter.useFilter(insts, m_replaceMissing); } insts = Filter.useFilter(insts, m_ntob); if (!m_OutputFormatDefined) { setOutputFormat(); } for (Instance instance : insts) { push(convertInstance(instance), false); // No need to copy } flushInput(); m_NewBatch = true; m_FirstBatchDone = true; return (numPendingOutput() != 0); }