@Override public boolean input(Instance instance) throws Exception {
  if (getInputFormat() == null) {
    throw new IllegalStateException("No input instance format defined");
  }
  if (m_NewBatch) {
    resetQueue();
    m_NewBatch=false;
  }
  if (isFirstBatchDone()) {
    ArrayList<Instance> fv=new ArrayList<Instance>();
    int firstCopy=convertInstancewoDocNorm(instance,fv);
    Instance inst=fv.get(0);
    if (m_filterType != FILTER_NONE) {
      normalizeInstance(inst,firstCopy);
    }
    push(inst);
    return true;
  }
 else {
    bufferInput(instance);
    return false;
  }
}

@ Override public boolean input ( Instance instance ) throws Exception { if ( getInputFormat ( ) == null ) { throw new IllegalStateException ( "No input instance format defined" ) ; } if ( m_NewBatch ) { resetQueue ( ) ; m_NewBatch = false ; } if ( isFirstBatchDone ( ) ) { ArrayList < Instance > fv = new ArrayList < Instance > ( ) ; int firstCopy = convertInstancewoDocNorm ( instance , fv ) ; Instance inst = fv . get ( 0 ) ; if ( m_filterType != FILTER_NONE ) { normalizeInstance ( inst , firstCopy ) ; } push ( inst ) ; return true ; } else { bufferInput ( instance ) ; return false ; } }
input an instance for filtering . filter requires all training instances be read before producing output .
