@Test public void testIntersects() { Span a = new Span(10, 50); Span b = new Span(40, 100); Assert.assertTrue(a.intersects(b)); Assert.assertTrue(b.intersects(a)); Span c = new Span(10, 20); Span d = new Span(40, 50); Assert.assertFalse(c.intersects(d)); Assert.assertFalse(d.intersects(c)); Assert.assertTrue(b.intersects(d)); }
public boolean intersects(Span s) { int sstart = s.getStart(); return this.contains(s) || s.contains(this) || getStart() <= sstart && sstart < getEnd() || sstart <= getStart() && getStart() < s.getEnd(); }
Span implements Comparable<Span>, Serializable { public boolean intersects(Span s) { int sstart = s.getStart(); return this.contains(s) || s.contains(this) || getStart() <= sstart && sstart < getEnd() || sstart <= getStart() && getStart() < s.getEnd(); } }
Span implements Comparable<Span>, Serializable { public boolean intersects(Span s) { int sstart = s.getStart(); return this.contains(s) || s.contains(this) || getStart() <= sstart && sstart < getEnd() || sstart <= getStart() && getStart() < s.getEnd(); } Span(int s, int e, String type);  Span(int s, int e, String type, double prob);  Span(int s, int e);  Span(int s, int e, double prob);  Span(Span span, int offset);  Span(Span span, double prob); }
Span implements Comparable<Span>, Serializable { public boolean intersects(Span s) { int sstart = s.getStart(); return this.contains(s) || s.contains(this) || getStart() <= sstart && sstart < getEnd() || sstart <= getStart() && getStart() < s.getEnd(); } Span(int s, int e, String type);  Span(int s, int e, String type, double prob);  Span(int s, int e);  Span(int s, int e, double prob);  Span(Span span, int offset);  Span(Span span, double prob); int getStart(); int getEnd(); String getType(); int length(); boolean contains(Span s); boolean contains(int index); boolean startsWith(Span s); boolean intersects(Span s); boolean crosses(Span s); CharSequence getCoveredText(CharSequence text); Span trim(CharSequence text); int compareTo(Span s); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); static String[] spansToStrings(Span[] spans, CharSequence s); static String[] spansToStrings(Span[] spans, String[] tokens); double getProb(); }
Span implements Comparable<Span>, Serializable { public boolean intersects(Span s) { int sstart = s.getStart(); return this.contains(s) || s.contains(this) || getStart() <= sstart && sstart < getEnd() || sstart <= getStart() && getStart() < s.getEnd(); } Span(int s, int e, String type);  Span(int s, int e, String type, double prob);  Span(int s, int e);  Span(int s, int e, double prob);  Span(Span span, int offset);  Span(Span span, double prob); int getStart(); int getEnd(); String getType(); int length(); boolean contains(Span s); boolean contains(int index); boolean startsWith(Span s); boolean intersects(Span s); boolean crosses(Span s); CharSequence getCoveredText(CharSequence text); Span trim(CharSequence text); int compareTo(Span s); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); static String[] spansToStrings(Span[] spans, CharSequence s); static String[] spansToStrings(Span[] spans, String[] tokens); double getProb();  }