U
- type of the userspublic abstract class UserNeighborhood<U> extends Object implements Neighborhood, FastUserIndex<U>
Modifier and Type | Field and Description |
---|---|
protected Neighborhood |
neighborhood
Generic fast neighborhood.
|
protected FastUserIndex<U> |
uIndex
Fast user index.
|
Constructor and Description |
---|
UserNeighborhood(FastUserIndex<U> uIndex,
Neighborhood neighborhood)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Stream<Tuple2id> |
getNeighbors(int idx)
Returns the neighborhood of a user/index.
|
Stream<Tuple2od<U>> |
getNeighbors(U u)
Returns a stream of user neighbors
|
int |
numUsers()
Counts the number of indexed users.
|
U |
uidx2user(int uidx)
Returns the user represented with the index.
|
int |
user2uidx(U u)
Returns the index assigned to the user.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsUser, getAllUidx, getAllUsers, uidx2user, uidx2user, user2uidx, user2uidx
protected final FastUserIndex<U> uIndex
protected final Neighborhood neighborhood
public UserNeighborhood(FastUserIndex<U> uIndex, Neighborhood neighborhood)
uIndex
- fast user indexneighborhood
- generic fast neighborhoodpublic int numUsers()
UserIndex
public int user2uidx(U u)
FastUserIndex
user2uidx
in interface FastUserIndex<U>
u
- userpublic U uidx2user(int uidx)
FastUserIndex
uidx2user
in interface FastUserIndex<U>
uidx
- user indexpublic Stream<Tuple2id> getNeighbors(int idx)
getNeighbors
in interface Neighborhood
idx
- user/index whose neighborhood is calculatedCopyright © 2016. All rights reserved.