calhoun.analysis.crf.io
Class OutputHandlerComposite

java.lang.Object
  extended by calhoun.analysis.crf.io.OutputHandlerComposite
All Implemented Interfaces:
OutputHandler, java.io.Serializable

public class OutputHandlerComposite
extends java.lang.Object
implements OutputHandler

an output handler that allows multiple output handlers to be configured. Each result is handed to each output handler in the list.

See Also:
Serialized Form

Constructor Summary
OutputHandlerComposite()
           
 
Method Summary
 java.util.List<OutputHandler> getHandlers()
          retursn the configured list of output handler.
 void outputComplete()
          indicates the writing of output is complete.
 void setHandlers(java.util.List<OutputHandler> handlers)
          sets the list of output handlers
 void setOutputLocation(java.lang.String location)
          sets the output location to write to.
 void writeOutput(InputSequence<?> sequence, int[] hiddenStates)
          Writes out a set of predicted hidden states.
 void writeTestOutput(InputSequence<?> sequence, int[] truePath, int[] hiddenStates)
          Writes out a set of hidden states compared with a known true path.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputHandlerComposite

public OutputHandlerComposite()
Method Detail

setOutputLocation

public void setOutputLocation(java.lang.String location)
Description copied from interface: OutputHandler
sets the output location to write to. This is called before any of the write functions are called.

Specified by:
setOutputLocation in interface OutputHandler
Parameters:
location - the location to write the data to. The meaning is implementation dependent.

writeOutput

public void writeOutput(InputSequence<?> sequence,
                        int[] hiddenStates)
                 throws java.io.IOException
Description copied from interface: OutputHandler
Writes out a set of predicted hidden states. The location will have been specified previously with OutputHandler.setOutputLocation(java.lang.String)

Specified by:
writeOutput in interface OutputHandler
Parameters:
sequence - the input sequence on which predictions were made
hiddenStates - an array of state indices for the predicted hidden states.
Throws:
java.io.IOException

writeTestOutput

public void writeTestOutput(InputSequence<?> sequence,
                            int[] truePath,
                            int[] hiddenStates)
                     throws java.io.IOException
Description copied from interface: OutputHandler
Writes out a set of hidden states compared with a known true path. The location will have been specified previously with OutputHandler.setOutputLocation(java.lang.String)

Specified by:
writeTestOutput in interface OutputHandler
Parameters:
sequence - the input sequence on which predictions were made
truePath - an array of hidden states representing the true path.
hiddenStates - an array of state indices for the predicted hidden states.
Throws:
java.io.IOException

outputComplete

public void outputComplete()
                    throws java.io.IOException
Description copied from interface: OutputHandler
indicates the writing of output is complete. The handler can do any final processing and release resources.

Specified by:
outputComplete in interface OutputHandler
Throws:
java.io.IOException

getHandlers

public java.util.List<OutputHandler> getHandlers()
retursn the configured list of output handler.

Returns:
returns the output handlers

setHandlers

public void setHandlers(java.util.List<OutputHandler> handlers)
sets the list of output handlers

Parameters:
handlers - a list of output handlers. The output handlers will be called in order for each prediction or test result.