Feld implements Comparable<Feld>, Cloneable { public final boolean overlapsWith(final Feld other) { if (this.byteAdresse == other.byteAdresse) { return false; } if (this.byteAdresse < other.byteAdresse) { return this.getEndAdresse() >= other.byteAdresse; } return other.getEndAdresse() >= this.byteAdresse; } Feld();  Feld(final Enum feldX);  Feld(final Enum feldX, final FeldInfo info);  Feld(final String name, final String s, final Align alignment);  Feld(final Bezeichner name, final int start, final String s, final Align alignment);  Feld(final Bezeichner bezeichner, final int length, final int start, final Align alignment);  Feld(final String name, final int length, final int start, final char c, final Align alignment);  Feld(final String name, final int length, final int start, final String s, final Align alignment);  Feld(final String name, final int start, final char c);  Feld(final int start, final String s, final Align alignment);  Feld(final int length, final Align alignment);  Feld(final int length, final int start, final Align alignment);  Feld(final Feld other); static Feld createFeld(final Enum feldX, final FeldInfo info); String getBezeichnung(); Bezeichner getBezeichner(); final void setInhalt(final String s); void setInhalt(final int n); void setInhalt(final char c); void setInhalt(final char c, final int i); String getInhalt(); void resetInhalt(); void setAnzahlBytes(final int n); final int getAnzahlBytes(); final int getByteAdresse(); final int getEndAdresse(); final boolean overlapsWith(final Feld other); final void write(final Writer writer); boolean isEmpty(); boolean hasValue(); boolean isValid(); boolean isInvalid(); List<ConstraintViolation> validate(); String format(); @Override String toString(); @Override final boolean equals(final Object obj); @Override final int hashCode(); @Override final int compareTo(final Feld other); static Bezeichner getAsBezeichner(final Enum feldX); static String getAsBezeichnung(final Enum feldX); static String toBezeichnung(final Enum name); @SuppressWarnings("squid:S2975") @Override Object clone(); static final Feld NULL_FELD; }
@Test public void testOverlapsWith() { Feld a = new Feld(new Bezeichner("a"), 2, 1, Align.LEFT); Feld b = new Feld(new Bezeichner("b"), 2, 3, Align.LEFT); Feld c = new Feld(new Bezeichner("c"), 2, 2, Align.LEFT); assertFalse(a + " overlaps with " + b, a.overlapsWith(b)); assertFalse(b + " overlaps with " + a, b.overlapsWith(a)); assertTrue(b + " doesn't overlap with " + c, b.overlapsWith(c)); assertTrue(c + " doesn't overlap with " + a, c.overlapsWith(a)); assertTrue(c + " doesn't overlap with " + b, c.overlapsWith(b)); }