/*
* $Id: Collaborator.java 562 2005-10-24 19:03:40Z hengels $
* (c) Copyright 2004 con:cern development team.
*
* This file is part of con:cern (http://concern.org).
*
* con:cern is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* Please see COPYING for the complete licence.
*/
package org.concern.model;
public class Collaborator
extends Element
{
public static final int ONE_TO_ONE = 0;
public static final int ONE_TO_MANY = 1;
public static final int MANY_TO_ONE = 2;
public static final int MANY_TO_MANY = 3;
String implementation = "";
int cardinality;
public Collaborator() {
super(null);
}
public Collaborator(String name) {
super(name);
}
public int getCardinality() {
return cardinality;
}
public void setCardinality(int cardinality) {
if (cardinality < 0 || cardinality > 3)
throw new IllegalArgumentException("ONE_TO_ONE, ONE_TO_MANY, MANY_TO_ONE or MANY_TO_MANY");
int old = this.cardinality;
this.cardinality = cardinality;
changes.firePropertyChange("cardinality", old, cardinality);
}
}
|