/** * Returns true if selection attribute is nominal. * * @return true if selection attribute is nominal */ public boolean isNominal() { if (getInputFormat() == null) { return false; } else { return getInputFormat().attribute(m_AttIndex.getIndex()).isNominal(); } }
/** * Returns true if selection attribute is nominal. * * @return true if selection attribute is nominal */ public boolean isNominal() { if (getInputFormat() == null) { return false; } else { return getInputFormat().attribute(m_AttIndex.getIndex()).isNominal(); } }
/** * 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"); } // process input if (m_Values == null) { determineValues(getInputFormat()); setOutputFormat(); } flushInput(); m_NewBatch = true; m_FirstBatchDone = 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"); } // process input if (m_Values == null) { determineValues(getInputFormat()); setOutputFormat(); } flushInput(); m_NewBatch = true; m_FirstBatchDone = true; return (numPendingOutput() != 0); }
/** * Input an instance for filtering. Ordinarily the instance is processed and * made available for output immediately. Some filters require all instances * be read before producing output. * * @param instance the input instance * @return true if the filtered instance may now be collected with output(). * @throws IllegalStateException if no input format has been set. */ @Override public boolean input(Instance instance) { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); } if (m_NewBatch) { resetQueue(); m_NewBatch = false; } if (isFirstBatchDone()) { push(instance); return true; } else { bufferInput(instance); return false; } }
/** * Input an instance for filtering. Ordinarily the instance is processed and * made available for output immediately. Some filters require all instances * be read before producing output. * * @param instance the input instance * @return true if the filtered instance may now be collected with output(). * @throws IllegalStateException if no input format has been set. */ @Override public boolean input(Instance instance) { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); } if (m_NewBatch) { resetQueue(); m_NewBatch = false; } if (isFirstBatchDone()) { push(instance); return true; } else { bufferInput(instance); return false; } }
instanceInfo = new Instances(getInputFormat(), 0); // copy before modifying Attribute oldAtt = instanceInfo.attribute(m_AttIndex.getIndex()); int[] selection = new int[m_Values.size()];
instanceInfo = new Instances(getInputFormat(), 0); // copy before modifying Attribute oldAtt = instanceInfo.attribute(m_AttIndex.getIndex()); int[] selection = new int[m_Values.size()];
instances = modifyHeader(getInputFormat()); } else { instances = new Instances(getInputFormat(), 0); for (i = 0; i < getInputFormat().numInstances(); i++) { instance = getInputFormat().instance(i); if (instance.isMissing(m_AttIndex.getIndex())) { push(instance, false); // No need to copy because of bufferInput()
instances = modifyHeader(getInputFormat()); } else { instances = new Instances(getInputFormat(), 0); for (i = 0; i < getInputFormat().numInstances(); i++) { instance = getInputFormat().instance(i); if (instance.isMissing(m_AttIndex.getIndex())) { push(instance, false); // No need to copy because of bufferInput()
if (getInputFormat() != null) { setInputFormat(getInputFormat());
if (getInputFormat() != null) { setInputFormat(getInputFormat());