com.aelitis.azureus.core.util.bloom.impl
Class BloomFilterImpl

java.lang.Object
  extended by com.aelitis.azureus.core.util.bloom.impl.BloomFilterImpl
All Implemented Interfaces:
BloomFilter
Direct Known Subclasses:
BloomFilterAddOnly, BloomFilterAddRemove4Bit, BloomFilterAddRemove8Bit

public abstract class BloomFilterImpl
extends Object
implements BloomFilter


Field Summary
protected static String MY_PACKAGE
           
 
Constructor Summary
BloomFilterImpl(int _max_entries)
           
BloomFilterImpl(Map<String,Object> x)
           
 
Method Summary
 int add(byte[] value)
           
protected  int add(int value)
           
protected  int bytesToInteger(byte[] data)
           
 void clear()
           
 boolean contains(byte[] value)
           
protected  boolean contains(int value)
           
 int count(byte[] value)
           
protected  int count(int value)
           
protected abstract  int decValue(int index)
           
static BloomFilter deserialiseFromMap(Map<String,Object> map)
           
 int getEntryCount()
          Returns number of unique entries
protected  int getHash(int function, int value)
           
protected  int getMaxEntries()
           
protected static byte[] getSerialization(byte[] address, int port)
           
 int getSize()
          Returns overall capacity
 long getStartTimeMono()
           
 String getString()
           
protected abstract  int getValue(int index)
           
protected abstract  int incValue(int index)
           
static void main(String[] args)
           
 int remove(byte[] value)
           
protected  int remove(int value)
           
 Map<String,Object> serialiseToMap()
           
protected  void serialiseToMap(Map<String,Object> x)
           
protected abstract  int trimValue(int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.aelitis.azureus.core.util.bloom.BloomFilter
getReplica
 

Field Detail

MY_PACKAGE

protected static final String MY_PACKAGE
See Also:
Constant Field Values
Constructor Detail

BloomFilterImpl

public BloomFilterImpl(int _max_entries)

BloomFilterImpl

public BloomFilterImpl(Map<String,Object> x)
Method Detail

deserialiseFromMap

public static BloomFilter deserialiseFromMap(Map<String,Object> map)

serialiseToMap

protected void serialiseToMap(Map<String,Object> x)

serialiseToMap

public Map<String,Object> serialiseToMap()
Specified by:
serialiseToMap in interface BloomFilter

getMaxEntries

protected int getMaxEntries()

add

public int add(byte[] value)
Specified by:
add in interface BloomFilter

remove

public int remove(byte[] value)
Specified by:
remove in interface BloomFilter

count

public int count(byte[] value)
Specified by:
count in interface BloomFilter

contains

public boolean contains(byte[] value)
Specified by:
contains in interface BloomFilter

add

protected int add(int value)

remove

protected int remove(int value)

count

protected int count(int value)

contains

protected boolean contains(int value)

getValue

protected abstract int getValue(int index)

incValue

protected abstract int incValue(int index)

decValue

protected abstract int decValue(int index)

trimValue

protected abstract int trimValue(int value)

getHash

protected int getHash(int function,
                      int value)

bytesToInteger

protected int bytesToInteger(byte[] data)

getEntryCount

public int getEntryCount()
Description copied from interface: BloomFilter
Returns number of unique entries

Specified by:
getEntryCount in interface BloomFilter
Returns:

getSize

public int getSize()
Description copied from interface: BloomFilter
Returns overall capacity

Specified by:
getSize in interface BloomFilter
Returns:

clear

public void clear()
Specified by:
clear in interface BloomFilter

getStartTimeMono

public long getStartTimeMono()
Specified by:
getStartTimeMono in interface BloomFilter

getSerialization

protected static byte[] getSerialization(byte[] address,
                                         int port)

getString

public String getString()
Specified by:
getString in interface BloomFilter

main

public static void main(String[] args)