01: /*
02: * $Id: Collaborator.java 562 2005-10-24 19:03:40Z hengels $
03: * (c) Copyright 2004 con:cern development team.
04: *
05: * This file is part of con:cern (http://concern.org).
06: *
07: * con:cern is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU Lesser General Public License
09: * as published by the Free Software Foundation; either version 2.1
10: * of the License, or (at your option) any later version.
11: *
12: * Please see COPYING for the complete licence.
13: */
14: package org.concern.model;
15:
16: public class Collaborator extends Element {
17: public static final int ONE_TO_ONE = 0;
18: public static final int ONE_TO_MANY = 1;
19: public static final int MANY_TO_ONE = 2;
20: public static final int MANY_TO_MANY = 3;
21:
22: String implementation = "";
23: int cardinality;
24:
25: public Collaborator() {
26: super (null);
27: }
28:
29: public Collaborator(String name) {
30: super (name);
31: }
32:
33: public int getCardinality() {
34: return cardinality;
35: }
36:
37: public void setCardinality(int cardinality) {
38: if (cardinality < 0 || cardinality > 3)
39: throw new IllegalArgumentException(
40: "ONE_TO_ONE, ONE_TO_MANY, MANY_TO_ONE or MANY_TO_MANY");
41: int old = this .cardinality;
42: this .cardinality = cardinality;
43: changes.firePropertyChange("cardinality", old, cardinality);
44: }
45: }
|