@Test public void testEquals() { Span a1 = new Span(100, 1000, "test"); Span a2 = new Span(100, 1000, "test"); Assert.assertTrue(a1.equals(a2)); Span b1 = new Span(100, 100, "test"); Assert.assertFalse(a1.equals(b1)); Span c1 = new Span(100, 1000, "Test"); Assert.assertFalse(a1.equals(c1)); Span d1 = new Span(100, 1000); Assert.assertFalse(d1.equals(a1)); Assert.assertFalse(a1.equals(d1)); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Span) { Span s = (Span) o; return getStart() == s.getStart() && getEnd() == s.getEnd() && Objects.equals(getType(), s.getType()); } return false; }
Span implements Comparable<Span>, Serializable { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Span) { Span s = (Span) o; return getStart() == s.getStart() && getEnd() == s.getEnd() && Objects.equals(getType(), s.getType()); } return false; } }
Span implements Comparable<Span>, Serializable { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Span) { Span s = (Span) o; return getStart() == s.getStart() && getEnd() == s.getEnd() && Objects.equals(getType(), s.getType()); } return false; } 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 { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Span) { Span s = (Span) o; return getStart() == s.getStart() && getEnd() == s.getEnd() && Objects.equals(getType(), s.getType()); } return false; } 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 { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Span) { Span s = (Span) o; return getStart() == s.getStart() && getEnd() == s.getEnd() && Objects.equals(getType(), s.getType()); } return false; } 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();  }