/** * @param mode the digital representation of a {@link Mode} * @return the owner {@link Bits} */ public static Bits extractOwnerBits(short mode) { return Bits.values()[(mode >>> 6) & 7]; }
/** * Sets {@link Mode} bits using a digital representation. * * @param n the digital representation of a {@link Mode} */ public void fromShort(short n) { Bits[] v = Bits.values(); set(v[(n >>> 6) & 7], v[(n >>> 3) & 7], v[n & 7]); }
/** * @param mode the digital representation of a {@link Mode} * @return the other {@link Bits} */ public static Bits extractOtherBits(short mode) { return Bits.values()[mode & 7]; }
/** * @param mode the digital representation of a {@link Mode} * @return the group {@link Bits} */ public static Bits extractGroupBits(short mode) { return Bits.values()[(mode >>> 3) & 7]; }
/** * @param mode the digital representation of a {@link Mode} * @return the other {@link Bits} */ public static Bits extractOtherBits(short mode) { return Bits.values()[mode & 7]; }
/** * @param mode the digital representation of a {@link Mode} * @return the group {@link Bits} */ public static Bits extractGroupBits(short mode) { return Bits.values()[(mode >>> 3) & 7]; }
/** * Sets {@link Mode} bits using a digital representation. * * @param n the digital representation of a {@link Mode} */ public void fromShort(short n) { Bits[] v = Bits.values(); set(v[(n >>> 6) & 7], v[(n >>> 3) & 7], v[n & 7]); }
/** * @param mode the digital representation of a {@link Mode} * @return the owner {@link Bits} */ public static Bits extractOwnerBits(short mode) { return Bits.values()[(mode >>> 6) & 7]; }
/** * Tests {@link Mode.Bits#toAclActionSet()}. */ @Test public void toAclActions() { for (Mode.Bits bits : Mode.Bits.values()) { Assert.assertEquals(bits, new AclActions(bits.toAclActionSet()).toModeBits()); } } }