FileDocCategorySizeDatePackage
BloomFilterAddRemove8Bit.javaAPI DocAzureus 3.0.3.42013Thu Feb 09 19:42:48 GMT 2006com.aelitis.azureus.core.util.bloom.impl

BloomFilterAddRemove8Bit

public class BloomFilterAddRemove8Bit extends BloomFilterImpl

Fields Summary
private byte[]
map
Constructors Summary
public BloomFilterAddRemove8Bit(int _max_entries)

		super( _max_entries );
			
		map	= new byte[getMaxEntries()];
	
Methods Summary
protected intdecValue(int index)

		int	original_value = getValue( index );

		if ( original_value <= 0 ){
			
			return( 0 );
		}
				
		setValue( index, (byte)(original_value-1));
		
		return( original_value );
	
protected intgetValue(int index)

		return( map[index] & 0xff );
	
protected intincValue(int index)

		int	original_value = getValue( index );
		
		if ( original_value >= 255 ){
			
			return( 255 );
		}
				
		setValue( index, (byte)(original_value+1));
		
		return( original_value );
	
private voidsetValue(int index, byte value)

		map[index] = value;
	
protected inttrimValue(int value)

		if ( value < 0 ){
			return( 0 );
		}else if ( value > 255 ){
			return( 255 );
		}else{
			return( value );
		}