/** * Retrieves a flag * @see Flags */ public boolean getFlag(int bit) { checkFlag(bit); // bits are indexed from left to right return (flags & (1 << (15 - bit))) != 0; }
/** * Retrieves a flag * @see Flags */ public boolean getFlag(int bit) { checkFlag(bit); // bits are indexed from left to right return (flags & (1 << (15 - bit))) != 0; }
/** * Sets a flag to the supplied value * @see Flags */ public void unsetFlag(int bit) { checkFlag(bit); // bits are indexed from left to right flags &= ~(1 << (15 - bit)); }
/** * Sets a flag to the supplied value * @see Flags */ public void unsetFlag(int bit) { checkFlag(bit); // bits are indexed from left to right flags &= ~(1 << (15 - bit)); }
static int setFlag(int flags, int bit, boolean value) { checkFlag(bit); // bits are indexed from left to right if (value) return flags |= (1 << (15 - bit)); else return flags &= ~(1 << (15 - bit)); }
/** * Sets a flag to the supplied value * @see Flags */ public void setFlag(int bit) { checkFlag(bit); // bits are indexed from left to right flags |= (1 << (15 - bit)); }
/** * Retrieves a flag * @see Flags */ public boolean getFlag(int bit) { checkFlag(bit); // bits are indexed from left to right return (flags & (1 << (15 - bit))) != 0; }
/** * Sets a flag to the supplied value * @see Flags */ public void setFlag(int bit) { checkFlag(bit); // bits are indexed from left to right flags |= (1 << (15 - bit)); }
/** * Sets a flag to the supplied value * @see Flags */ public void unsetFlag(int bit) { checkFlag(bit); // bits are indexed from left to right flags &= ~(1 << (15 - bit)); }
/** * Sets a flag to the supplied value * @see Flags */ public void setFlag(int bit) { checkFlag(bit); // bits are indexed from left to right flags |= (1 << (15 - bit)); }
/** * Retrieves a flag * @see Flags */ public boolean getFlag(int bit) { checkFlag(bit); // bits are indexed from left to right return (flags & (1 << (15 - bit))) != 0; }
/** * Sets a flag to the supplied value * @see Flags */ public void setFlag(int bit) { checkFlag(bit); flags = setFlag(flags, bit, true); }
/** * Sets a flag to the supplied value * @see Flags */ public void unsetFlag(int bit) { checkFlag(bit); flags = setFlag(flags, bit, false); }