@Test public void testCompareToEqualsNullType2() { Span a = new Span(30, 1000, "b"); Span b = new Span(30, 1000); Assert.assertEquals(true, a.compareTo(b) == -1); }
public int compareTo(Span s) { if (getStart() < s.getStart()) { return -1; } else if (getStart() == s.getStart()) { if (getEnd() > s.getEnd()) { return -1; } else if (getEnd() < s.getEnd()) { return 1; } else { if (getType() == null && s.getType() == null) { return 0; } else if (getType() != null && s.getType() != null) { return getType().compareTo(s.getType()); } else if (getType() != null) { return -1; } return 1; } } else { return 1; } }
Span implements Comparable<Span>, Serializable { public int compareTo(Span s) { if (getStart() < s.getStart()) { return -1; } else if (getStart() == s.getStart()) { if (getEnd() > s.getEnd()) { return -1; } else if (getEnd() < s.getEnd()) { return 1; } else { if (getType() == null && s.getType() == null) { return 0; } else if (getType() != null && s.getType() != null) { return getType().compareTo(s.getType()); } else if (getType() != null) { return -1; } return 1; } } else { return 1; } } }
Span implements Comparable<Span>, Serializable { public int compareTo(Span s) { if (getStart() < s.getStart()) { return -1; } else if (getStart() == s.getStart()) { if (getEnd() > s.getEnd()) { return -1; } else if (getEnd() < s.getEnd()) { return 1; } else { if (getType() == null && s.getType() == null) { return 0; } else if (getType() != null && s.getType() != null) { return getType().compareTo(s.getType()); } else if (getType() != null) { return -1; } return 1; } } else { return 1; } } 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 int compareTo(Span s) { if (getStart() < s.getStart()) { return -1; } else if (getStart() == s.getStart()) { if (getEnd() > s.getEnd()) { return -1; } else if (getEnd() < s.getEnd()) { return 1; } else { if (getType() == null && s.getType() == null) { return 0; } else if (getType() != null && s.getType() != null) { return getType().compareTo(s.getType()); } else if (getType() != null) { return -1; } return 1; } } else { return 1; } } 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 int compareTo(Span s) { if (getStart() < s.getStart()) { return -1; } else if (getStart() == s.getStart()) { if (getEnd() > s.getEnd()) { return -1; } else if (getEnd() < s.getEnd()) { return 1; } else { if (getType() == null && s.getType() == null) { return 0; } else if (getType() != null && s.getType() != null) { return getType().compareTo(s.getType()); } else if (getType() != null) { return -1; } return 1; } } else { return 1; } } 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();  }