de.aitools.iv.mds.util
Class FuzzySimilarityHashSet

java.lang.Object
  extended by de.aitools.iv.mds.util.FuzzySimilarityHashSet

public class FuzzySimilarityHashSet
extends java.lang.Object

Author:
Anita

Constructor Summary
FuzzySimilarityHashSet(int n)
          Creates a new instance of FuzzySimilarityHashSet.
FuzzySimilarityHashSet(int n, int s)
          Creates a new instance of FuzzySimilarityHashSet.
 
Method Summary
 void add(int index, java.math.BigInteger[] hashes)
          Adds an object.
 int[] getSimilar(int index, java.math.BigInteger[] hashes)
          Returns similar objects based on the hash values of input object.
 boolean isEmpty()
          Returns if hashset is empty.
 int size()
          Returns number of objects.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FuzzySimilarityHashSet

public FuzzySimilarityHashSet(int n)
Creates a new instance of FuzzySimilarityHashSet.

Parameters:
n - number of hashfunctions

FuzzySimilarityHashSet

public FuzzySimilarityHashSet(int n,
                              int s)
Creates a new instance of FuzzySimilarityHashSet.

Parameters:
n - number of hashfunctions
s - number of samples to be returned if more are found
Method Detail

size

public int size()
Returns number of objects.

Returns:
number of objects

isEmpty

public boolean isEmpty()
Returns if hashset is empty.

Returns:
true if numer of objects is 0

add

public void add(int index,
                java.math.BigInteger[] hashes)
Adds an object.

Parameters:
index - index of object
hashes - array of hash values of object

getSimilar

public int[] getSimilar(int index,
                        java.math.BigInteger[] hashes)
Returns similar objects based on the hash values of input object.

Parameters:
index - index of object for which similar ones should be found
hashes - array of hash values of object
Returns:
array with noOfSamples or less indices of similar objects found