src/main/java/kweimann/mezzure/model/Element1D.java
/* returns true if two elements overlap */
returns true if two elements overlap
returns true if two elements overlap
default boolean overlaps(Element1D element) {
        int thisCenter = this.center() * 2 + (this.length() % 2 == 0 ? 0 : 1);
        int thatCenter = element.center() * 2 + (element.length() % 2 == 0 ? 0 : 1);
        return Math.abs(thatCenter - thisCenter) <= element.length() + this.length();
    }
default boolean overlaps ( Element1D element ) { int thisCenter = this . center ( ) * 2 + ( this . length ( ) % 2 == 0 ? 0 : 1 ) ; int thatCenter = element . center ( ) * 2 + ( element . length ( ) % 2 == 0 ? 0 : 1 ) ; return Math . abs ( thatCenter - thisCenter ) <= element . length ( ) + this . length ( ) ; }
returns true if two elements overlap
returns true if two elements overlap