01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: // This file is part of KeY - Integrated Deductive Software Design
10: // Copyright (C) 2001-2004 Universitaet Karlsruhe, Germany
11: // Universitaet Koblenz-Landau, Germany
12: // Chalmers University of Technology, Sweden
13: //
14: // The KeY system is protected by the GNU General Public License.
15: // See LICENSE.TXT for details.
16: package de.uka.ilkd.key.proof.decproc;
17:
18: import de.uka.ilkd.key.logic.Term;
19:
20: /**
21: * A Wrapper class to export different .hashCode() and .equals(o) functions
22: */
23: public class UninterpretedTermWrapper {
24: private Term eps;
25:
26: public UninterpretedTermWrapper(Term term) {
27: eps = term;
28: }
29:
30: /**
31: * Returns A hash code compatible with the equalsModRenaming function of eps.
32: * For now this is a dummy value which forces HashSets to put all
33: * UninterpretedTermWrappers in the same slot so that the .equals(o)
34: * function has to be employed.
35: * Later this linear effort should be replaced.
36: * @returns A hash code compatible with the equalsModRenaming function of eps.
37: */
38: public int hashCode() {
39: return 42;
40: }
41:
42: /**
43: * Returns true iff eps.equalsModRenaming(o).
44: * @returns true iff eps.equalsModRenaming(o)
45: * @param o The Object which eps should be compared with;
46: * if o is not a Term, then normal .equals is used.
47: */
48: public boolean equals(Object o) {
49: if (o instanceof Term)
50: return ((Term) eps).equalsModRenaming(o);
51: else
52: return false;
53: }
54:
55: }
|