Coverage Report - org.deri.wsmo4j.choreography.rule.ForAllRI
 
Classes in this File Line Coverage Branch Coverage Complexity
ForAllRI
0%
0/14
N/A
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.Set;
 22  
 
 23  
 import org.deri.wsmo4j.io.serializer.wsml.*;
 24  
 import org.omwg.ontology.Variable;
 25  
 import org.wsmo.common.*;
 26  
 import org.wsmo.service.choreography.rule.ChoreographyForAll;
 27  
 import org.wsmo.service.rule.*;
 28  
 
 29  
 /**
 30  
  * Reference Implementation for the ForAll rule.
 31  
  * 
 32  
  * <pre>
 33  
  *     Created on Jul 26, 2005
 34  
  *     Committed by $Author: vassil_momtchev $
 35  
  *     $Source$
 36  
  * </pre>
 37  
  * 
 38  
  * @author Thomas Haselwanter
 39  
  * @author James Scicluna
 40  
  * 
 41  
  * @version $Revision: 1844 $ $Date: 2006-10-24 17:11:48 +0300 (Tue, 24 Oct 2006) $
 42  
  */
 43  
 public class ForAllRI extends AbstractQuantifiedRuleRI implements ChoreographyForAll {
 44  
 
 45  
     /**
 46  
      * Constructor for a forall rule.
 47  
      * 
 48  
      * @param variable
 49  
      *            Quantified variable object.
 50  
      * @param condition
 51  
      *            A LogicalExpression defining the condition of the rule
 52  
      * @param rule
 53  
      *            Inner Rule of forall
 54  
      */
 55  
     public ForAllRI(Variable variable, Condition condition, ChoreographyRule rule) {
 56  0
         this(makeSet(variable), condition, makeSet(rule));
 57  0
     }
 58  
 
 59  
     /**
 60  
      * Constructor for a forall rule
 61  
      * 
 62  
      * @param variables
 63  
      *            A set of quantified Variable objects
 64  
      * @param condition
 65  
      *            A LogicalExpression defining the condition of the rule
 66  
      * @param rule
 67  
      *            Inner Rule of forall
 68  
      */
 69  
     public ForAllRI(Set<Variable> variables, Condition condition, ChoreographyRule rule) {
 70  0
         this(variables, condition, makeSet(rule));
 71  0
     }
 72  
 
 73  
     /**
 74  
      * Constructor for a choose rule.
 75  
      * 
 76  
      * @param variable
 77  
      *            Quantified variable object.
 78  
      * @param condition
 79  
      *            A LogicalExpression defining the condition of the rule
 80  
      * @param rules
 81  
      *            A set of inner Rule objects
 82  
      */
 83  
     public ForAllRI(Variable variable, Condition condition, Set<ChoreographyRule> rules) {
 84  0
         this(makeSet(variable), condition, rules);
 85  0
     }
 86  
 
 87  
     /**
 88  
      * Constructor for a choose rule
 89  
      * 
 90  
      * @param variables
 91  
      *            A set of quantified Variable objects
 92  
      * @param condition
 93  
      *            A LogicalExpression defining the condition of the rule
 94  
      * @param rules
 95  
      *            A set of inner Rule objects
 96  
      */
 97  
     public ForAllRI(Set<Variable> variables, Condition condition, Set<ChoreographyRule> rules) {
 98  0
         super(variables, condition, rules);
 99  0
     }
 100  
 
 101  
     /*
 102  
      * (non-Javadoc)
 103  
      * 
 104  
      * @see org.wsmo.service.choreography.rule.Rule#accept(org.wsmo.service.choreography.rule.Visitor)
 105  
      */
 106  
     public void accept(Visitor visitor) {
 107  0
         visitor.visitChoreographyForAll(this);
 108  0
     }
 109  
 
 110  
     /* (non-Javadoc)
 111  
      * @see org.wsmo.service.choreography.rule.Rule#toString(org.wsmo.common.TopEntity)
 112  
      */
 113  
     public String toString(TopEntity te) {
 114  0
         VisitorSerializeWSMLTransitionRules visitor = new VisitorSerializeWSMLTransitionRules(te);
 115  0
         visitor.visitChoreographyForAll(this);
 116  0
         return visitor.getSerializedObject();
 117  
     }
 118  
     
 119  
     @Override
 120  
     public String toString() {
 121  0
         return toString(null);
 122  
     }
 123  
 }