private boolean getThenPerformAdj ( int operation , int position , boolean value ) { checkMutable ( ) ; final int i = position >> ADDRESS_BITS ; final long m = 1L << ( position & ADDRESS_MASK ) ; final long v = bits [ i ] & m ; switch ( operation ) { case SET : if ( value ) { bits [ i ] |= m ; } else { bits [ i ] &= ~ m ; } break ; case AND : if ( value ) { /* no-op */ } else { bits [ i ] &= ~ m ; } break ; case OR : if ( value ) { bits [ i ] |= m ; } else { /* no-op */ } break ; case XOR : if ( value ) { bits [ i ] ^= m ; } else { /* no-op */ } break ; } return v != 0 ; }
separate implementation from performAdj is an optimization