Interface InteractionWriter<T extends Interaction>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Closes the InteractionWriter.
      void end()
      Method to call when we reach the end
      void flush()
      Flushes the writer (commit or write on disk)
      void initialiseContext​(Map<String,​Object> options)
      Initialise the context of the InteractionWriter given a map of options
      void reset()
      This method will reset the writer from all loaded options.
      void start()
      Method to call before starting to write but after initialising the context
      void write​(Collection<? extends T> interactions)
      Writes a collection of Interaction objects
      void write​(Iterator<? extends T> interactions)
      Writes Interaction objects using iterator
      void write​(T interaction)
      Writes an interaction
    • Method Detail

      • initialiseContext

        void initialiseContext​(Map<String,​Object> options)
        Initialise the context of the InteractionWriter given a map of options
        Parameters:
        options - : the options given by the user
      • start

        void start()
            throws MIIOException
        Method to call before starting to write but after initialising the context
        Throws:
        MIIOException - if cannot start writing
      • write

        void write​(T interaction)
            throws MIIOException
        Writes an interaction
        Parameters:
        interaction - : the interaction to write
        Throws:
        MIIOException - : if cannot write
      • write

        void write​(Collection<? extends T> interactions)
            throws MIIOException
        Writes a collection of Interaction objects
        Parameters:
        interactions - : the interactions to write
        Throws:
        MIIOException - : if cannot write
      • write

        void write​(Iterator<? extends T> interactions)
            throws MIIOException
        Writes Interaction objects using iterator
        Parameters:
        interactions - : the iterator of interactions to write
        Throws:
        MIIOException - : if cannot write
      • close

        void close()
            throws MIIOException
        Closes the InteractionWriter. It will flushes before closing. It will close any provided outputStream and writer.
        Throws:
        MIIOException - : if cannot close
      • reset

        void reset()
            throws MIIOException
        This method will reset the writer from all loaded options. The interaction writer will be back to what is was before the initialiseContext was called. To re-use the interaction writer after calling the reset() method, the data source needs to be re-initialised with initialiseContext. Any provided ouputStream or writer will not be closed and will have to be closed separately.
        Throws:
        MIIOException - : if cannot reset