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 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.Writer
Writes the prediction.- Specified by:
write
in 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-