Interface ProCAKEWriter

All Superinterfaces:
IO
All Known Implementing Classes:
AbstractXMLWriter, DependencyWriter, ModelWriter, NESTGraphWriter, NESTSequentialWorkflowWriter, NESTWorkflowWriter, ObjectPoolWriter, ObjectWriter, SimilarityModelWriter, TrainingPoolWriter, WorkflowGraphMLYWriter, WorkflowWriter

public interface ProCAKEWriter extends IO
The ProCAKEWriter interface provides some common constants and methods for all io writers. The usage of a writer is quite simple:
 public void writeMyObject(Object value) {
        ProCAKEWriter writer = (ProCAKEWriter) IOFactory.newIO(value.getClass());
        writer.setFilename("..."); // or use writer.setOutputStream(os)
        writer.store(value);
 }
 

The ProCAKEWriter has to guarantee that store(Object) is able to write the object for that IO.isHandlerFor(Class) is true.

Author:
Rainer Maximini
  • Field Details

  • Method Details

    • setFilename

      void setFilename(String filename)
      Each writer must be able to write a file to the local filesystem. The filename should be an absolute path.
      Parameters:
      filename - The filename into which the object should be stored.
    • setOutputStream

      void setOutputStream(OutputStream output)
      Each writer must be able to store the object into an OutputStream.
      Parameters:
      output - The OutputStream into that the object should be stored.
    • store

      void store(Object value) throws CAKEIOException
      The store command writes the given value.
      Parameters:
      value - The object that should be stored
      Throws:
      CAKEIOException