Coverage Report - org.deri.wsmo4j.rule.RelationFactRI
 
Classes in this File Line Coverage Branch Coverage Complexity
RelationFactRI
0%
0/17
0%
0/8
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.rule;
 20  
 
 21  
 import java.util.*;
 22  
 
 23  
 import org.omwg.logicalexpression.*;
 24  
 import org.wsmo.service.rule.*;
 25  
 
 26  
 /**
 27  
  * Interface or class description
 28  
  *
 29  
  * @author James Scicluna
 30  
  * @author Thomas Haselwanter
 31  
  * @author Vassil Momtchev
 32  
  *
 33  
  * Created on 03-Feb-2006
 34  
  * Committed by $Author: vassil_momtchev $
 35  
  *
 36  
  * $Source$,
 37  
  * @version $Revision: 1844 $ $Date: 2006-10-24 17:11:48 +0300 (Tue, 24 Oct 2006) $
 38  
  */
 39  
 
 40  
 public class RelationFactRI implements RelationFact {
 41  
 
 42  
     private Atom atom;
 43  
     
 44  
     /**
 45  
      * Default constructor RelationFactRI
 46  
      */
 47  0
     public RelationFactRI() {
 48  0
     }
 49  
     
 50  
     /**
 51  
      * Constructor
 52  
      * @param atom contained atom in the relation
 53  
      * @throws IllegalArgumentException
 54  
      */
 55  0
     public RelationFactRI(Atom atom) {
 56  0
         if (atom == null) {
 57  0
             throw new IllegalArgumentException("Null atom!");
 58  
         }
 59  0
         this.atom = atom;
 60  0
     }
 61  
     
 62  
     public Atom getAtom() {
 63  0
         return atom;
 64  
     }
 65  
     
 66  
     public void setAtom(Atom atom) {
 67  0
         this.atom = atom;
 68  0
     }
 69  
 
 70  
     /* (non-Javadoc)
 71  
      * @see org.wsmo.service.choreography.rule.CompoundFact#isEmpty()
 72  
      */
 73  
     public boolean isEmpty() {
 74  0
         if (atom == null || atom.listParameters().size() == 0) {
 75  0
             return true;
 76  
         }
 77  0
         return false;
 78  
     }
 79  
     
 80  
     public Iterator<AtomicExpression> iterator() {
 81  0
         LinkedList<AtomicExpression> list =  new LinkedList<AtomicExpression>();
 82  0
         if (atom != null) {
 83  0
             list.add(atom);
 84  
         }
 85  0
         return list.iterator();
 86  
     }
 87  
 }
 88  
 
 89  
 /*
 90  
  * $Log$
 91  
  * Revision 1.1  2006/10/24 14:11:48  vassil_momtchev
 92  
  * choreography/orchestration rules refactored. different types where appropriate now supported
 93  
  *
 94  
  * Revision 1.3  2006/04/17 07:54:26  vassil_momtchev
 95  
  * assocition level between RelationFact and Atom descreased to containment from inheritance; public Iterator<AtomicExpression> iterator() method added
 96  
  *
 97  
  * Revision 1.2  2006/02/10 15:31:03  vassil_momtchev
 98  
  * implementation changed according the api change
 99  
  *
 100  
 */