/** * Indicates whether this segment can be merged with the given {@code other} segment. * <p> * Two segments can be merged when their mask is identical, and the only difference in SegmentID is in the first * 1-bit of their mask. * * @param other the Segment to verify mergeability for * @return {@code true} if the segments can be merged, otherwise {@code false} */ public boolean isMergeableWith(Segment other) { return this.mask == other.mask && mergeableSegmentId() == other.getSegmentId(); }
/** * Indicates whether this segment can be merged with the given {@code other} segment. * <p> * Two segments can be merged when their mask is identical, and the only difference in SegmentID is in the first * 1-bit of their mask. * * @param other the Segment to verify mergeability for * @return {@code true} if the segments can be merged, otherwise {@code false} */ public boolean isMergeableWith(Segment other) { return this.mask == other.mask && mergeableSegmentId() == other.getSegmentId(); }
/** * Indicates whether this segment can be merged with the given {@code other} segment. * <p> * Two segments can be merged when their mask is identical, and the only difference in SegmentID is in the first * 1-bit of their mask. * * @param other the Segment to verify mergeability for * @return {@code true} if the segments can be merged, otherwise {@code false} */ public boolean isMergeableWith(Segment other) { return this.mask == other.mask && mergeableSegmentId() == other.getSegmentId(); }