## milk.experiment
Interface MIResultListener

All Superinterfaces:
  java.io.Serializable

All Known Implementing Classes:
  MICSVResultListener, MIDatabaseResultListener

public interface MIResultListener
extends java.io.Serializable

Interface for objects able to listen for results obtained by a ResultProducer

Method Summary
`void` `acceptResult(MIResultProducer rp, java.lang.Object[] key, java.lang.Object[] result)` Accepts results from a ResultProducer.
`java.lang.String[]` `determineColumnConstraints(MIResultProducer rp)` Determines if there are any constraints (imposed by the destination) on additional result columns to be produced by resultProducers.
`boolean` `isResultRequired(MIResultProducer rp, java.lang.Object[] key)` Determines whether the results for a specified key must be generated.
`void` `postProcess(MIResultProducer rp)` Perform any postprocessing.
`void` `preProcess(MIResultProducer rp)` Prepare for the results to be received.

Method Detail

### determineColumnConstraints

    public java.lang.String[] determineColumnConstraints(MIResultProducer rp)
                                                  throws java.lang.Exception

  Determines if there are any constraints (imposed by the destination) on additional result columns to be produced by resultProducers. Null should be returned if there are NO constraints, otherwise a list of column names should be returned as an array of Strings.

  Parameters:
    `rp` - the ResultProducer to which the constraints will apply
  Returns:
    an array of column names to which resutltProducer's additional results will be restricted.
  Throws:
    `java.lang.Exception` - if an error occurs

### preProcess

    public void preProcess(MIResultProducer rp)
                    throws java.lang.Exception

  Prepare for the results to be received.

  Parameters:
    `rp` - the ResultProducer that will generate the results
  Throws:
    `java.lang.Exception` - if an error occurs during preprocessing.

### postProcess

    public void postProcess(MIResultProducer rp)
                     throws java.lang.Exception

  Perform any postprocessing. When this method is called, it indicates that no more results will be sent that need to be grouped together in any way.

  Parameters:
    `rp` - the ResultProducer that generated the results
  Throws:
    `java.lang.Exception` - if an error occurs

### acceptResult

    public void acceptResult(MIResultProducer rp,
                             java.lang.Object[] key,
                             java.lang.Object[] result)
                      throws java.lang.Exception

  Accepts results from a ResultProducer.

  Parameters:
    `rp` - the ResultProducer that generated the results
    `key` - an array of Objects (Strings or Doubles) that uniquely identify a result for a given ResultProducer with given compatibilityState
    `result` - the results stored in an array. The objects stored in the array may be Strings, Doubles, or null (for the missing value).
  Throws:
    `java.lang.Exception` - if the result could not be accepted.

### isResultRequired

    public boolean isResultRequired(MIResultProducer rp,
                                    java.lang.Object[] key)
                             throws java.lang.Exception

  Determines whether the results for a specified key must be generated.

  Parameters:
    `rp` - the ResultProducer wanting to generate the results
    `key` - an array of Objects (Strings or Doubles) that uniquely identify a result for a given ResultProducer with given compatibilityState
  Returns:
    true if the result should be generated
  Throws:
    `java.lang.Exception` - if it could not be determined if the result is needed.