@Test public void testCompare1() { Range r1 = new Range(new Position(0, 0), new Position(0, 0)); Range r2 = new Range(new Position(0, 0), new Position(0, 0)); assertTrue(r1.compareTo(r2) == 0); }
@Override public int compareTo( Range r) { if (r == null) { return Integer.MIN_VALUE; } int c = m_start.compareTo(r.m_start); if (c != 0) { return c; } return m_end.compareTo(r.m_end); }
Range implements Comparable<Range> { @Override public int compareTo( Range r) { if (r == null) { return Integer.MIN_VALUE; } int c = m_start.compareTo(r.m_start); if (c != 0) { return c; } return m_end.compareTo(r.m_end); } }
Range implements Comparable<Range> { @Override public int compareTo( Range r) { if (r == null) { return Integer.MIN_VALUE; } int c = m_start.compareTo(r.m_start); if (c != 0) { return c; } return m_end.compareTo(r.m_end); } Range(/*@ non_null @*/ Position start, /*@ non_null @*/ Position end, int length);  Range(Position start, Position end); }
Range implements Comparable<Range> { @Override public int compareTo( Range r) { if (r == null) { return Integer.MIN_VALUE; } int c = m_start.compareTo(r.m_start); if (c != 0) { return c; } return m_end.compareTo(r.m_end); } Range(/*@ non_null @*/ Position start, /*@ non_null @*/ Position end, int length);  Range(Position start, Position end); Position getStart(); Position getEnd(); int getLength(); @Override /*@ pure non_null @*/ String toString(); boolean isWithin(/*@ non_null @*/ Position p); @Override int compareTo(/*@ nullable @*/ Range r); Range intersectWith(/*@ non_null @*/ Range r); Range setZero(/*@ non_null @*/ Position zero); @Override /*@ pure @*/ int hashCode(); @Override /*@ pure @*/ boolean equals(Object o); boolean isMultiLine(); static Range make(int start_l, int start_c, int end_l, int end_c); static Range make(int line, int start_c, int end_c); }
Range implements Comparable<Range> { @Override public int compareTo( Range r) { if (r == null) { return Integer.MIN_VALUE; } int c = m_start.compareTo(r.m_start); if (c != 0) { return c; } return m_end.compareTo(r.m_end); } Range(/*@ non_null @*/ Position start, /*@ non_null @*/ Position end, int length);  Range(Position start, Position end); Position getStart(); Position getEnd(); int getLength(); @Override /*@ pure non_null @*/ String toString(); boolean isWithin(/*@ non_null @*/ Position p); @Override int compareTo(/*@ nullable @*/ Range r); Range intersectWith(/*@ non_null @*/ Range r); Range setZero(/*@ non_null @*/ Position zero); @Override /*@ pure @*/ int hashCode(); @Override /*@ pure @*/ boolean equals(Object o); boolean isMultiLine(); static Range make(int start_l, int start_c, int end_l, int end_c); static Range make(int line, int start_c, int end_c);  }