private static int switchFlag ( final int flags , final int mask , final boolean value ) { int newFlags = value ? flags | mask : flags & ~ mask ; return newFlags ; }
A utility method to set or clear one or more bits in the given set of flags .