Permalink
Browse files

equals method

  • Loading branch information...
1 parent d8acbd3 commit 0e4270ecb3c8ccf44c35352914d663744c12e675 @seba-- committed Jan 27, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 compiler/org/sugarj/driver/sourcefilecontent/JavaSourceFileContent.java
@@ -58,4 +58,19 @@ else if (!importsOptional)
return code.toString();
}
+
+ public int hashCode() {
+ return packageDecl.hashCode() + imports.hashCode() + bodyDecls.hashCode();
+ }
+
+ public boolean equals(Object o) {
+ if (!(o instanceof JavaSourceFileContent))
+ return false;
+
+ JavaSourceFileContent other = (JavaSourceFileContent) o;
+ return other.packageDecl.equals(packageDecl) &&
+ other.imports.equals(imports) &&
+ other.importsOptional == importsOptional &&
+ other.bodyDecls.equals(bodyDecls);
+ }
}

0 comments on commit 0e4270e

Please sign in to comment.