public Instance nextElement(Instances dataset){
  Instance result;
  result=null;
  if (isIncremental()) {
    if (m_IncrementalBuffer != null) {
      result=m_IncrementalBuffer;
      m_IncrementalBuffer=null;
    }
 else {
      try {
        result=m_Loader.getNextInstance(dataset);
      }
 catch (      Exception e) {
        e.printStackTrace();
        result=null;
      }
    }
  }
 else {
    if (m_BatchCounter < m_BatchBuffer.numInstances()) {
      result=m_BatchBuffer.instance(m_BatchCounter);
      m_BatchCounter++;
    }
  }
  if (result != null) {
    result.setDataset(dataset);
  }
  return result;
}

public Instance nextElement ( Instances dataset ) { Instance result ; result = null ; if ( isIncremental ( ) ) { if ( m_IncrementalBuffer != null ) { result = m_IncrementalBuffer ; m_IncrementalBuffer = null ; } else { try { result = m_Loader . getNextInstance ( dataset ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; result = null ; } } } else { if ( m_BatchCounter < m_BatchBuffer . numInstances ( ) ) { result = m_BatchBuffer . instance ( m_BatchCounter ) ; m_BatchCounter ++ ; } } if ( result != null ) { result . setDataset ( dataset ) ; } return result ; }
returns the next element and sets the specified dataset , null if none available .
