public void selectiveClearing ( Key k , short scheme ) { if ( k == null ) { throw new NullPointerException ( "Key can not be null" ) ; } if ( ! membershipTest ( k ) ) { throw new IllegalArgumentException ( "Key is not a member" ) ; } int index = 0 ; int [ ] h = hash . hash ( k ) ; switch ( scheme ) { case RANDOM : index = randomRemove ( ) ; break ; case MINIMUM_FN : index = minimumFnRemove ( h ) ; break ; case MAXIMUM_FP : index = maximumFpRemove ( h ) ; break ; case RATIO : index = ratioRemove ( h ) ; break ; default : throw new AssertionError ( "Undefined selective clearing scheme" ) ; } clearBit ( index ) ; }
Performs the selective clearing for a given key .