[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor/model ItemPointer.java,1.2,1.3 Location.jav
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2006-01-15 11:41:26
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19648/src/org/python/pydev/editor/model Modified Files: ItemPointer.java Location.java Log Message: Index: ItemPointer.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/model/ItemPointer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ItemPointer.java 22 Apr 2004 10:35:22 -0000 1.2 --- ItemPointer.java 15 Jan 2006 11:41:14 -0000 1.3 *************** *** 27,29 **** --- 27,54 ---- this.end = end; } + + @Override + public boolean equals(Object obj) { + if(!(obj instanceof ItemPointer)){ + return false; + } + + ItemPointer i = (ItemPointer) obj; + if(!i.file.equals(file)){ + return false; + } + if(!i.start.equals(start)){ + return false; + } + if(!i.end.equals(end)){ + return false; + } + + return true; + } + + @Override + public int hashCode() { + return this.file.hashCode() * 17; + } } Index: Location.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/model/Location.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Location.java 27 Apr 2004 01:06:58 -0000 1.2 --- Location.java 15 Jan 2006 11:41:14 -0000 1.3 *************** *** 66,69 **** --- 66,83 ---- return 0; } + + @Override + public boolean equals(Object obj) { + if(!(obj instanceof Location)){ + return false; + } + Location l = (Location) obj; + return l.line == line && l.column == column; + } + + @Override + public int hashCode() { + return (line * 99) + (column * 5); + } /** |