Class TuplesLinkPredictionFormat.Writer

java.lang.Object
es.uam.eps.ir.relison.links.linkprediction.io.TuplesLinkPredictionFormat.Writer
All Implemented Interfaces:
LinkPredictionFormat.Writer<U>, java.io.Closeable, java.lang.AutoCloseable, java.util.function.Consumer<Prediction<U>>
Enclosing class:
TuplesLinkPredictionFormat<U>

protected class TuplesLinkPredictionFormat.Writer
extends java.lang.Object
implements LinkPredictionFormat.Writer<U>
Writer for the format.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private java.io.BufferedWriter writer
    A buffered writer.
  • Constructor Summary

    Constructors 
    Constructor Description
    Writer​(java.io.OutputStream out)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    void close()  
    void write​(Prediction<U> prediction)
    Writes the prediction.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Consumer

    andThen

    Methods inherited from interface es.uam.eps.ir.relison.links.linkprediction.io.LinkPredictionFormat.Writer

    accept
  • Field Details

    • writer

      private final java.io.BufferedWriter writer
      A buffered writer.
  • Constructor Details

    • Writer

      public Writer​(java.io.OutputStream out)
      Constructor.
      Parameters:
      out - an output stream where link prediction is written.
  • Method Details

    • write

      public void write​(Prediction<U> prediction) throws java.io.IOException
      Description copied from interface: LinkPredictionFormat.Writer
      Writes the prediction.
      Specified by:
      write in interface LinkPredictionFormat.Writer<U>
      Parameters:
      prediction - to be written
      Throws:
      java.io.IOException - when IO error
    • close

      public void close() throws java.io.IOException
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable
      Throws:
      java.io.IOException