| 
Rice Pastry API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectrice.p2p.util.BloomFilter
| Field Summary | |
protected  int | 
length
The length of the set to use  | 
static int | 
PARAMETER_LENGTH
The length of the random byte arrays which are generated  | 
protected  int[] | 
parameters
The parameters to the hash functions for this bloom filter  | 
protected  java.util.BitSet | 
set
The underlying bitset representation for this bloom filter  | 
| Constructor Summary | |
BloomFilter(int num,
            int length)
Constructor which takes the number of hash functions to use and the length of the set to use.  | 
|
| Method Summary | |
 void | 
add(byte[] array)
Method which adds an element to this bloom filter.  | 
 boolean | 
check(byte[] array)
Method which returns whether or not an element *may* be in the set.  | 
protected  int | 
doHash(byte[] array,
       int seed)
Method which performs a dumb hash of the provided array and the seed value.  | 
 java.lang.String | 
getBitSet()
Method which returns what the internal bit set looks like as a string  | 
protected  int | 
hash(byte[] array,
     int i)
Internal method which hashes the input argument using the ith hash function, and then mods the result by length.  | 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
protected int[] parameters
protected int length
protected java.util.BitSet set
public static int PARAMETER_LENGTH
| Constructor Detail | 
public BloomFilter(int num,
                   int length)
num - The number of hash functions to uselength - The length of the underlying bit set| Method Detail | 
public java.lang.String getBitSet()
public void add(byte[] array)
array - The element to addpublic boolean check(byte[] array)
array - The element to check for
protected int hash(byte[] array,
                   int i)
array - The element to hashi - The hash function to use
protected int doHash(byte[] array,
                     int seed)
array - The input arrayseed - DESCRIBE THE PARAMETER
  | 
Rice Pastry API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||