public class SNLSH<K,V> extends java.lang.Object implements RNNSearch<K,V>, java.io.Serializable
By default, the query object (reference equality) is excluded from the neighborhood.
Note that you may observe weird behavior with String objects. JVM will pool the string
literal objects. So the below variables
String a = "ABC";
String b = "ABC";
String c = "AB" + "C";
are actually equal in reference test a == b == c
. With toy data that you
type explicitly in the code, this will cause problems. Fortunately, the data would be
read from secondary storage in production.
LSH
,
SimHash
,
Serialized FormConstructor and Description |
---|
SNLSH(int L,
SimHash<K> hash)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
put(K k,
V v)
Adds a new item.
|
void |
range(K q,
double radius,
java.util.List<Neighbor<K,V>> neighbors)
Search the neighbors in the given radius of query object, i.e.
|