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.FastRecommendationfastFill(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).intnumFilled()Number of elements filled.intnumTotal()Number of total elements in the recommendation.voidreset()Resets the filler.protected abstract voidresetMethod()Resets the variables corresponding to the filler.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.recommendation.filler.FastFiller
fillerListMethods 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:FastFillerGiven 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:
fastFillin 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:FillerGiven 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:FillerNumber of elements filled. -
numTotal
public int numTotal()Description copied from interface:FillerNumber of total elements in the recommendation. -
reset
public void reset()Description copied from interface:FillerResets the filler. -
resetMethod
protected abstract void resetMethod()Resets the variables corresponding to the filler.
-