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: //
10:
11: package de.uka.ilkd.key.strategy;
12:
13: /**
14: * Singleton implementation of the <code>RuleAppCost</code> interface, which
15: * denotes a maximum cost (rule applications with this cost can't be afforded
16: * at all)
17: */
18: public class TopRuleAppCost implements RuleAppCost {
19:
20: private TopRuleAppCost() {
21: }
22:
23: public int compareTo(Object o) {
24: if (o instanceof TopRuleAppCost)
25: return 0;
26: return 1;
27: }
28:
29: public boolean equals(Object o) {
30: return compareTo(o) == 0;
31: }
32:
33: public int hashCode() {
34: return 91879827;
35: }
36:
37: public RuleAppCost add(RuleAppCost cost2) {
38: return INSTANCE;
39: }
40:
41: public String toString() {
42: return "Costs infinite";
43: }
44:
45: public static final TopRuleAppCost INSTANCE = new TopRuleAppCost();
46:
47: }
|