Class AbstractFastFiller<U,I>
java.lang.Object
es.uam.eps.ir.relison.links.recommendation.filler.AbstractFastFiller<U,I>
- Type Parameters:
U
- Type of the users.I
- Type of the items.
- All Implemented Interfaces:
FastFiller<U,I>
,Filler<U,I>
- Direct Known Subclasses:
IdFiller
,RandomFiller
public abstract class AbstractFastFiller<U,I> extends java.lang.Object implements FastFiller<U,I>
Abstract implementation of a fast filler.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AbstractFastFiller(es.uam.eps.ir.ranksys.fast.preference.FastPreferenceData<U,I> prefData)
Constructor. -
Method Summary
Modifier and Type Method Description es.uam.eps.ir.ranksys.fast.FastRecommendation
fastFill(es.uam.eps.ir.ranksys.fast.FastRecommendation rec, int cutoff, java.util.function.Function<U,java.util.function.IntPredicate> pred)
Given a recommendation, fills it with until it reaches the desired number of items (if possible).es.uam.eps.ir.ranksys.core.Recommendation<U,I>
fill(es.uam.eps.ir.ranksys.core.Recommendation<U,I> rec, int cutoff, java.util.function.Function<U,java.util.function.Predicate<I>> pred)
Given a recommendation, fills it with until it reaches the desired number of items (if possible).int
numFilled()
Number of elements filled.int
numTotal()
Number of total elements in the recommendation.void
reset()
Resets the filler.protected abstract void
resetMethod()
Resets the variables corresponding to the filler.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.recommendation.filler.FastFiller
fillerList
Methods inherited from interface es.uam.eps.ir.relison.links.recommendation.filler.Filler
fillerList
-
Field Details
-
Constructor Details
-
AbstractFastFiller
Constructor.- Parameters:
prefData
- preference data.
-
-
Method Details
-
fastFill
public es.uam.eps.ir.ranksys.fast.FastRecommendation fastFill(es.uam.eps.ir.ranksys.fast.FastRecommendation rec, int cutoff, java.util.function.Function<U,java.util.function.IntPredicate> pred)Description copied from interface:FastFiller
Given a recommendation, fills it with until it reaches the desired number of items (if possible). If the cutoff is greater than the indicated one, the recommendation is trimmed. Uses the index values of items.- Specified by:
fastFill
in interfaceFastFiller<U,I>
- Parameters:
rec
- the recommendation.cutoff
- the cutoff.pred
- a predicate for filtering the possible recommendations.- Returns:
- the new recommendation if everything is OK, null otherwise.
-
fill
public es.uam.eps.ir.ranksys.core.Recommendation<U,I> fill(es.uam.eps.ir.ranksys.core.Recommendation<U,I> rec, int cutoff, java.util.function.Function<U,java.util.function.Predicate<I>> pred)Description copied from interface:Filler
Given a recommendation, fills it with until it reaches the desired number of items (if possible). If the cutoff is greater than the indicated one, the recommendation is trimmed. -
numFilled
public int numFilled()Description copied from interface:Filler
Number of elements filled. -
numTotal
public int numTotal()Description copied from interface:Filler
Number of total elements in the recommendation. -
reset
public void reset()Description copied from interface:Filler
Resets the filler. -
resetMethod
protected abstract void resetMethod()Resets the variables corresponding to the filler.
-