| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| RulesRI |
|
| 0.0;0 |
| 1 | /* | |
| 2 | wsmo4j extension - a Choreography API and Reference Implementation | |
| 3 | ||
| 4 | Copyright (c) 2005, University of Innsbruck, Austria | |
| 5 | ||
| 6 | This library is free software; you can redistribute it and/or modify it under | |
| 7 | the terms of the GNU Lesser General Public License as published by the Free | |
| 8 | Software Foundation; either version 2.1 of the License, or (at your option) | |
| 9 | any later version. | |
| 10 | This library is distributed in the hope that it will be useful, but WITHOUT | |
| 11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
| 12 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | |
| 13 | details. | |
| 14 | You should have received a copy of the GNU Lesser General Public License along | |
| 15 | with this library; if not, write to the Free Software Foundation, Inc., | |
| 16 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 17 | */ | |
| 18 | ||
| 19 | package org.deri.wsmo4j.choreography.rule; | |
| 20 | ||
| 21 | import java.util.Collections; | |
| 22 | import java.util.HashSet; | |
| 23 | import java.util.Iterator; | |
| 24 | import java.util.Set; | |
| 25 | ||
| 26 | import org.wsmo.common.Identifier; | |
| 27 | import org.wsmo.service.choreography.rule.ChoreographyRules; | |
| 28 | import org.wsmo.service.rule.*; | |
| 29 | ||
| 30 | import com.ontotext.wsmo4j.common.EntityImpl; | |
| 31 | ||
| 32 | /** | |
| 33 | * Interface or class description | |
| 34 | * | |
| 35 | * @author James Scicluna | |
| 36 | * @author Thomas Haselwanter | |
| 37 | * | |
| 38 | * Created on 06-Dec-2005 Committed by $Author: vassil_momtchev $ | |
| 39 | * | |
| 40 | * $Source: | |
| 41 | * /cvsroot/wsmo4j/ext/choreography/src/ri/org/deri/wsmo4j/choreography/rule/RulesRI.java,v $, | |
| 42 | * @version $Revision: 1844 $ $Date: 2006-10-24 17:11:48 +0300 (Tue, 24 Oct 2006) $ | |
| 43 | */ | |
| 44 | ||
| 45 | public class RulesRI extends EntityImpl implements ChoreographyRules, Iterable { | |
| 46 | /** | |
| 47 | * @uml.property name="rules" | |
| 48 | * @uml.associationEnd multiplicity="(0 -1)" elementType="org.wsmo.service.rule.ChoreographyRule" | |
| 49 | */ | |
| 50 | 0 | Set<ChoreographyRule> rules = new HashSet<ChoreographyRule>(); |
| 51 | ||
| 52 | /** | |
| 53 | * Initializes the Rules container of Choreography Descriptions with the | |
| 54 | * given Identifier | |
| 55 | * | |
| 56 | * @param id | |
| 57 | * Identifier of the transition rules | |
| 58 | */ | |
| 59 | public RulesRI(Identifier id) { | |
| 60 | 0 | super(id); |
| 61 | 0 | } |
| 62 | ||
| 63 | /** | |
| 64 | * Initializes the Rules container of Choreography Descriptions with the | |
| 65 | * given Identifier and rules | |
| 66 | * | |
| 67 | * @param id | |
| 68 | * Identifier of the Rules Container | |
| 69 | * @param rules | |
| 70 | * A set of rules to be put in the container | |
| 71 | */ | |
| 72 | public RulesRI(Identifier id, Set<ChoreographyRule> rules) { | |
| 73 | 0 | this(id); |
| 74 | 0 | this.rules = rules; |
| 75 | 0 | } |
| 76 | ||
| 77 | /* | |
| 78 | * (non-Javadoc) | |
| 79 | * | |
| 80 | * @see org.wsmo.service.choreography.rule.Rules#listRules() | |
| 81 | */ | |
| 82 | public Set<ChoreographyRule> listRules() { | |
| 83 | 0 | return Collections.unmodifiableSet(this.rules); |
| 84 | } | |
| 85 | ||
| 86 | /* | |
| 87 | * (non-Javadoc) | |
| 88 | * | |
| 89 | * @see org.wsmo.service.choreography.rule.Rules#removeRule(org.wsmo.service.choreography.rule.Rule) | |
| 90 | */ | |
| 91 | public void removeRule(ChoreographyRule rule) { | |
| 92 | 0 | this.rules.remove(rule); |
| 93 | 0 | } |
| 94 | ||
| 95 | /* | |
| 96 | * (non-Javadoc) | |
| 97 | * | |
| 98 | * @see org.wsmo.service.choreography.rule.Rules#addRule(org.wsmo.service.choreography.rule.Rule) | |
| 99 | */ | |
| 100 | public void addRule(ChoreographyRule rule) { | |
| 101 | 0 | this.rules.add(rule); |
| 102 | 0 | } |
| 103 | ||
| 104 | public Iterator<ChoreographyRule> iterator() { | |
| 105 | 0 | return this.rules.iterator(); |
| 106 | } | |
| 107 | } |