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.BufferedWriterwriterA buffered writer. -
Constructor Summary
Constructors Constructor Description Writer(java.io.OutputStream out)Constructor. -
Method Summary
Modifier and Type Method Description voidclose()voidwrite(Prediction<U> prediction)Writes the prediction.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface es.uam.eps.ir.relison.links.linkprediction.io.LinkPredictionFormat.Writer
accept
-
Field Details
-
writer
private final java.io.BufferedWriter writerA 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
Description copied from interface:LinkPredictionFormat.WriterWrites the prediction.- Specified by:
writein interfaceLinkPredictionFormat.Writer<U>- Parameters:
prediction- to be written- Throws:
java.io.IOException- when IO error
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-