I - type of the itemspublic abstract class ItemNeighborhood<I> extends Object implements Neighborhood, FastItemIndex<I>
| Modifier and Type | Field and Description |
|---|---|
protected FastItemIndex<I> |
iIndex
Fast item index.
|
protected Neighborhood |
neighborhood
Generic neighborhood.
|
| Constructor and Description |
|---|
ItemNeighborhood(FastItemIndex<I> iIndex,
Neighborhood neighborhood)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Stream<Tuple2od<I>> |
getNeighbors(I i)
Returns a stream of item neighbors
|
Stream<Tuple2id> |
getNeighbors(int idx)
Returns the neighborhood of a user/index.
|
I |
iidx2item(int iidx)
Returns the item represented with the index.
|
int |
item2iidx(I i)
Returns the index assigned to the item.
|
int |
numItems()
Counts the number of indexed items.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsItem, getAllIidx, getAllItems, iidx2item, iidx2item, item2iidx, item2iidxprotected final FastItemIndex<I> iIndex
protected final Neighborhood neighborhood
public ItemNeighborhood(FastItemIndex<I> iIndex, Neighborhood neighborhood)
iIndex - fast item indexneighborhood - generic fast neighborhoodpublic int numItems()
ItemIndexpublic I iidx2item(int iidx)
FastItemIndexiidx2item in interface FastItemIndex<I>iidx - item indexpublic int item2iidx(I i)
FastItemIndexitem2iidx in interface FastItemIndex<I>i - itempublic Stream<Tuple2id> getNeighbors(int idx)
getNeighbors in interface Neighborhoodidx - user/index whose neighborhood is calculatedCopyright © 2016. All rights reserved.