@Test public void testHashCode() { Offset o1 = new Offset(0, 1); assertEquals("hashCode should be 962", 962, o1.hashCode()); }
@Override public int hashCode() { final int PRIME = 31; int result = 1; result = PRIME * result + begin; result = PRIME * result + end; return result; }
Offset implements Comparable<Offset> { @Override public int hashCode() { final int PRIME = 31; int result = 1; result = PRIME * result + begin; result = PRIME * result + end; return result; } }
Offset implements Comparable<Offset> { @Override public int hashCode() { final int PRIME = 31; int result = 1; result = PRIME * result + begin; result = PRIME * result + end; return result; } Offset(int begin, int end); }
Offset implements Comparable<Offset> { @Override public int hashCode() { final int PRIME = 31; int result = 1; result = PRIME * result + begin; result = PRIME * result + end; return result; } Offset(int begin, int end); int getBegin(); int getEnd(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(Offset o); }
Offset implements Comparable<Offset> { @Override public int hashCode() { final int PRIME = 31; int result = 1; result = PRIME * result + begin; result = PRIME * result + end; return result; } Offset(int begin, int end); int getBegin(); int getEnd(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(Offset o);  }