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.casetool;
12:
13: import de.uka.ilkd.key.logic.Name;
14:
15: /**
16: * An end of a UML association.
17: */
18: public class AssociationEnd {
19: private final Name roleName;
20: private final Multiplicity multiplicity;
21: private final ModelClass modelClass;
22:
23: public AssociationEnd(String roleName, Multiplicity multiplicity,
24: ModelClass modelClass) {
25: assert multiplicity != null;
26: assert modelClass != null;
27:
28: if (roleName == null) {
29: String className = modelClass.getClassName();
30: roleName = className.substring(0, 0).toLowerCase()
31: + className.substring(1);
32: }
33:
34: this .roleName = new Name(roleName);
35: this .multiplicity = multiplicity;
36: this .modelClass = modelClass;
37: }
38:
39: public AssociationEnd(Multiplicity multiplicity,
40: ModelClass modelClass) {
41: this (null, multiplicity, modelClass);
42: }
43:
44: public Name getRoleName() {
45: return roleName;
46: }
47:
48: public Multiplicity getMultiplicity() {
49: return multiplicity;
50: }
51:
52: public ModelClass getModelClass() {
53: return modelClass;
54: }
55: }
|