01: //Copyright (c) Hans-Joachim Daniels 2005
02: //
03: //This program is free software; you can redistribute it and/or modify
04: //it under the terms of the GNU General Public License as published by
05: //the Free Software Foundation; either version 2 of the License, or
06: //(at your option) any later version.
07: //
08: //This program is distributed in the hope that it will be useful,
09: //but WITHOUT ANY WARRANTY; without even the implied warranty of
10: //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: //GNU General Public License for more details.
12: //
13: //You can either finde the file LICENSE or LICENSE.TXT in the source
14: //distribution or in the .jar file of this application
15:
16: package de.uka.ilkd.key.ocl.gf;
17:
18: /**
19: * Small tuple class for two Strings.
20: * The main use is grouping command and showname for GF commands before
21: * they are processed.
22: * This class is mutable.
23: * Equality is bound to the first argument.
24: * @author daniels
25: */
26: class StringTuple {
27: String first;
28: String second;
29:
30: /**
31: * Just sets both values.
32: * @param f Well, the first String
33: * @param s Well, the second String
34: * (if it is used at all)
35: */
36: public StringTuple(String f, String s) {
37: this .first = f;
38: this .second = s;
39: }
40:
41: public int hashCode() {
42: return this .first.hashCode();
43: }
44:
45: public boolean equals(Object o) {
46: if (o instanceof StringTuple) {
47: return this .first.equals(((StringTuple) o).first);
48: } else {
49: return false;
50: }
51: }
52:
53: public String toString() {
54: return this.first;
55: }
56: }
|