1 package net.sf.quarrel.uml.impl;
2
3 import net.sf.quarrel.uml.Element;
4 import net.sf.quarrel.uml.Relationship;
5 import net.sf.quarrel.uml.RelationshipType;
6
7 /***
8 * An implemention of the Relationship interface.
9 */
10 public class RelationshipImpl
11 implements Relationship {
12
13 /***
14 * The type of the relationship, such as dependency, generalization,
15 * aggregation, etc.
16 */
17 private final RelationshipType _type;
18
19 /***
20 * The independent element.
21 */
22 private final Element _supplier;
23
24 /***
25 * The dependent element.
26 */
27 private final Element _client;
28
29 /***
30 * Creates a new instance.
31 *
32 * @param type the type of the relationship.
33 * @param client the dependent element.
34 * @param supplier the independent element.
35 */
36 public RelationshipImpl(RelationshipType type,
37 Element client,
38 Element supplier) {
39 _type = type;
40 _supplier = supplier;
41 _client = client;
42 }
43
44 /***
45 * {@inheritDoc}
46 */
47 public RelationshipType getType() {
48 return _type;
49 }
50
51 /***
52 * {@inheritDoc}
53 */
54 public Element getSupplier() {
55 return _supplier;
56 }
57
58 /***
59 * {@inheritDoc}
60 */
61 public Element getClient() {
62 return _client;
63 }
64
65 }