edu.cmu.sphinx.util
Class PooledBatchManager

java.lang.Object
  extended byedu.cmu.sphinx.util.PooledBatchManager
All Implemented Interfaces:
BatchManager

public class PooledBatchManager
extends java.lang.Object
implements BatchManager

A simple implementation of the batch manager suitable for single threaded batch processing


Constructor Summary
PooledBatchManager(java.lang.String filename, int skip)
          Creates a pooled batch manager
 
Method Summary
 java.lang.String getFilename()
          Returns the name of the file
 BatchItem getNextItem()
          Gets the next available batch item or null if no more are available
 void start()
          Starts processing the batch
 void stop()
          Stops processing the batch
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PooledBatchManager

public PooledBatchManager(java.lang.String filename,
                          int skip)
Creates a pooled batch manager

Parameters:
filename - the name of the batch file
skip - items to skip between runs
Method Detail

start

public void start()
           throws java.io.IOException
Starts processing the batch

Specified by:
start in interface BatchManager
Throws:
java.io.IOException - if an error occurs while processing the batch file

getNextItem

public BatchItem getNextItem()
                      throws java.io.IOException
Gets the next available batch item or null if no more are available

Specified by:
getNextItem in interface BatchManager
Returns:
the next available batch item
Throws:
java.io.IOException - if an I/O error occurs while reading the next item from the batch file.

stop

public void stop()
          throws java.io.IOException
Stops processing the batch

Specified by:
stop in interface BatchManager
Throws:
java.io.IOException - if an error occurs while processing the batch file

getFilename

public java.lang.String getFilename()
Returns the name of the file

Specified by:
getFilename in interface BatchManager
Returns:
the filename