java.lang.Object
es.uam.eps.ir.relison.examples.EmptyWriter<U,I>
Type Parameters:
U
- Type of the users.
I
- Type of the items
All Implemented Interfaces:
java.io.Closeable
, java.lang.AutoCloseable
, java.util.function.Consumer<es.uam.eps.ir.ranksys.core.Recommendation<U,I>>
, java.util.function.Supplier<java.util.stream.Stream<es.uam.eps.ir.ranksys.core.Recommendation<U,I>>>
, org.ranksys.formats.rec.RecommendationFormat.Reader<U,I>
, org.ranksys.formats.rec.RecommendationFormat.Writer<U,I>
public class EmptyWriter<U,I>
extends java.lang.Object
implements org.ranksys.formats.rec.RecommendationFormat.Writer<U,I>, org.ranksys.formats.rec.RecommendationFormat.Reader<U,I>
Class for storing / reading recommendations on RAM memory.
Field Summary
Fields
Modifier and Type
Field
Description
private java.util.concurrent.ConcurrentLinkedQueue<es.uam.eps.ir.ranksys.core.Recommendation<U ,I >>
recs
List for storing the recommendations.
Constructor Summary
Constructors
Constructor
Description
EmptyWriter ()
Constructor.
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method
Description
void
close ()
java.util.stream.Stream<es.uam.eps.ir.ranksys.core.Recommendation<U ,I >>
readAll ()
void
write (es.uam.eps.ir.ranksys.core.Recommendation<U ,I > recommendation)
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 org.ranksys.formats.rec.RecommendationFormat.Reader
get
Methods inherited from interface org.ranksys.formats.rec.RecommendationFormat.Writer
accept
Field Details
private final java.util.concurrent.ConcurrentLinkedQueue<es.uam.eps.ir.ranksys.core.Recommendation<U ,I >> recs
List for storing the recommendations.
Constructor Details
public EmptyWriter ()
Constructor.
Method Details
public void write (
es.uam.eps.ir.ranksys.core.Recommendation<U ,I > recommendation)
Specified by:
write
in interface org.ranksys.formats.rec.RecommendationFormat.Writer<U ,I >
public void close ()
Specified by:
close
in interface java.lang.AutoCloseable
Specified by:
close
in interface java.io.Closeable
public java.util.stream.Stream<es.uam.eps.ir.ranksys.core.Recommendation<U ,I >> readAll ()
Specified by:
readAll
in interface org.ranksys.formats.rec.RecommendationFormat.Reader<U ,I >