/** * Intersects this mask with the given reasons mask. * * @param mask The mask to intersect with. * @return The intersection of this and teh given mask. */ ReasonsMask intersect(ReasonsMask mask) { ReasonsMask _mask = new ReasonsMask(); _mask.addReasons(new ReasonsMask(_reasons & mask.getReasons())); return _mask; }
/** * Returns <code>true</code> if the passed reasons mask has new reasons. * * @param mask The reasons mask which should be tested for new reasons. * @return <code>true</code> if the passed reasons mask has new reasons. */ boolean hasNewReasons(ReasonsMask mask) { return ((_reasons | mask.getReasons() ^ _reasons) != 0); }
/** * Adds all reasons from the reasons mask to this mask. * * @param mask The reasons mask to add. */ void addReasons(ReasonsMask mask) { _reasons = _reasons | mask.getReasons(); }