/** * Signifies that this batch of input to the filter is finished. If the filter * requires all instances prior to filtering, output() may now be called to * retrieve the filtered instances. * * @return true if there are instances pending output. * @throws IllegalStateException if no input structure has been defined. */ @Override public boolean batchFinished() { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); } if (!isOutputFormatDefined()) { setOutputFormat(); // Convert pending input instances for (int i = 0; i < getInputFormat().numInstances(); i++) { push((Instance) getInputFormat().instance(i).copy(), false); // No need to copy } } flushInput(); m_NewBatch = true; return (numPendingOutput() != 0); }
/** * Signifies that this batch of input to the filter is finished. If the filter * requires all instances prior to filtering, output() may now be called to * retrieve the filtered instances. * * @return true if there are instances pending output. * @throws IllegalStateException if no input structure has been defined. */ @Override public boolean batchFinished() { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); } if (!isOutputFormatDefined()) { setOutputFormat(); // Convert pending input instances for (int i = 0; i < getInputFormat().numInstances(); i++) { push((Instance) getInputFormat().instance(i).copy(), false); // No need to copy } } flushInput(); m_NewBatch = true; return (numPendingOutput() != 0); }
newAtts = new ArrayList<Attribute>(getInputFormat().numAttributes()); for (int j = 0; j < getInputFormat().numAttributes(); j++) { Attribute att = getInputFormat().attribute(j); if (!m_AttIndices.isInRange(j) || !att.isString()) { newData = new Instances(getInputFormat().relationName(), newAtts, 0); newData.setClassIndex(getInputFormat().classIndex()); setOutputFormat(newData);
newAtts = new ArrayList<Attribute>(getInputFormat().numAttributes()); for (int j = 0; j < getInputFormat().numAttributes(); j++) { Attribute att = getInputFormat().attribute(j); if (!m_AttIndices.isInRange(j) || !att.isString()) { newData = new Instances(getInputFormat().relationName(), newAtts, 0); newData.setClassIndex(getInputFormat().classIndex()); setOutputFormat(newData);
if (getInputFormat() != null) { setInputFormat(getInputFormat());
if (getInputFormat() != null) { setInputFormat(getInputFormat());
public boolean input(Instance instance) { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined");
public boolean input(Instance instance) { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined");