public void updateByModeBits ( Mode . Bits bits ) { // Each index equals to corresponding AclAction's ordinal. // E.g. Mode.Bits.READ corresponds to AclAction.READ, the former has index 0 in indexedBits, // the later has ordinal 0 in AclAction. Mode . Bits [ ] indexedBits = new Mode . Bits [ ] { Mode . Bits . READ , Mode . Bits . WRITE , Mode . Bits . EXECUTE } ; for ( int i = 0 ; i < 3 ; i ++ ) { if ( bits . imply ( indexedBits [ i ] ) ) { mActions . set ( i ) ; } else { mActions . clear ( i ) ; } } }
Updates permitted actions based on the mode bits .