|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.onelab.filter.Filter
org.onelab.filter.CountingBloomFilter
public final class CountingBloomFilter
Implements a counting Bloom filter, as defined by Fan et al. in a ToN 2000 paper.
A counting Bloom filter is an improvement to standard a Bloom filter as it allows dynamic additions and deletions of set membership information. This is achieved through the use of a counting vector instead of a bit vector. contract European Commission One-Lab Project 034819.
The general behavior of a filter
,
Summary cache: a scalable wide-area web cache sharing protocolField Summary |
---|
Fields inherited from class org.onelab.filter.Filter |
---|
hash |
Constructor Summary | |
---|---|
CountingBloomFilter()
Default constructor - use with readFields |
|
CountingBloomFilter(int vectorSize,
int nbHash)
Constructor |
Method Summary | |
---|---|
void |
add(Key key)
Adds a key to this filter. |
void |
and(Filter filter)
Peforms a logical AND between this filter and a specified filter. |
Object |
clone()
|
int |
compareTo(Object o)
|
void |
delete(Key key)
Removes a specified key from this counting Bloom filter. |
boolean |
equals(Object o)
|
int |
hashCode()
|
boolean |
membershipTest(Key key)
Determines wether a specified key belongs to this filter. |
void |
not()
Performs a logical NOT on this filter. |
void |
or(Filter filter)
Peforms a logical OR between this filter and a specified filter. |
void |
readFields(DataInput in)
Reads the fields of this object from in . |
String |
toString()
|
void |
write(DataOutput out)
Writes the fields of this object to out . |
void |
xor(Filter filter)
Peforms a logical XOR between this filter and a specified filter. |
Methods inherited from class org.onelab.filter.Filter |
---|
add, add, add |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CountingBloomFilter()
public CountingBloomFilter(int vectorSize, int nbHash)
vectorSize
- The vector size of this filter.nbHash
- The number of hash function to consider.Method Detail |
---|
public void add(Key key)
Filter
add
in class Filter
key
- The key to add.public void delete(Key key)
Invariant: nothing happens if the specified key does not belong to this counter Bloom filter.
key
- The key to remove.public void and(Filter filter)
Filter
Invariant: The result is assigned to this filter.
and
in class Filter
filter
- The filter to AND with.public boolean membershipTest(Key key)
Filter
membershipTest
in class Filter
key
- The key to test.
public void not()
Filter
The result is assigned to this filter.
not
in class Filter
public void or(Filter filter)
Filter
Invariant: The result is assigned to this filter.
or
in class Filter
filter
- The filter to OR with.public void xor(Filter filter)
Filter
Invariant: The result is assigned to this filter.
xor
in class Filter
filter
- The filter to XOR with.public String toString()
toString
in class Object
public Object clone()
clone
in class Object
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Filter
public void write(DataOutput out) throws IOException
Writable
out
.
write
in interface Writable
write
in class Filter
IOException
public void readFields(DataInput in) throws IOException
Writable
in
. For efficiency,
implementations should attempt to re-use storage in the existing object
where possible.
readFields
in interface Writable
readFields
in class Filter
IOException
public int compareTo(Object o)
compareTo
in interface Comparable
compareTo
in class Filter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |