@Test public void testCompareTo() { Hit o1 = new Hit("/foo", null, null, false, false); Hit o2 = new Hit("/foo", "hi", "there", false, false); assertEquals(o2.compareTo(o1), o1.compareTo(o2)); o1.setFilename("bar"); assertFalse(o2.compareTo(o1) == o1.compareTo(o2)); }
@Override public int compareTo(Hit o) throws ClassCastException { return filename.compareTo(o.filename); }
Hit implements Comparable<Hit> { @Override public int compareTo(Hit o) throws ClassCastException { return filename.compareTo(o.filename); } }
Hit implements Comparable<Hit> { @Override public int compareTo(Hit o) throws ClassCastException { return filename.compareTo(o.filename); } Hit();  Hit(String filename, String line, String lineno, boolean binary, boolean alt); }
Hit implements Comparable<Hit> { @Override public int compareTo(Hit o) throws ClassCastException { return filename.compareTo(o.filename); } Hit();  Hit(String filename, String line, String lineno, boolean binary, boolean alt); String getFilename(); String getPath(); String getDirectory(); void setFilename(String filename); String getLine(); void setLine(String line); String getLineno(); void setLineno(String lineno); @Override int compareTo(Hit o); boolean isBinary(); void setBinary(boolean binary); String getTag(); void setTag(String tag); boolean getAlt(); @Override boolean equals(Object o); @Override int hashCode(); }
Hit implements Comparable<Hit> { @Override public int compareTo(Hit o) throws ClassCastException { return filename.compareTo(o.filename); } Hit();  Hit(String filename, String line, String lineno, boolean binary, boolean alt); String getFilename(); String getPath(); String getDirectory(); void setFilename(String filename); String getLine(); void setLine(String line); String getLineno(); void setLineno(String lineno); @Override int compareTo(Hit o); boolean isBinary(); void setBinary(boolean binary); String getTag(); void setTag(String tag); boolean getAlt(); @Override boolean equals(Object o); @Override int hashCode();  }