Clover coverage report - Maven Clover report
Coverage timestamp: Tue Sep 16 2008 01:16:37 EEST
file stats: LOC: 158   Methods: 5
NCLOC: 93   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AbstractLogicalExpressionFactoryImpl.java 0% 0% 0% 0%
coverage
 1    /*
 2    wsmo4j - a WSMO API and Reference Implementation
 3    Copyright (c) 2005, University of Innsbruck, Austria
 4    This library is free software; you can redistribute it and/or modify it under
 5    the terms of the GNU Lesser General Public License as published by the Free
 6    Software Foundation; either version 2.1 of the License, or (at your option)
 7    any later version.
 8    This library is distributed in the hope that it will be useful, but WITHOUT
 9    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 10    FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 11    details.
 12    You should have received a copy of the GNU Lesser General Public License along
 13    with this library; if not, write to the Free Software Foundation, Inc.,
 14    59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 15    */
 16    package org.deri.wsmo4j.factory;
 17   
 18   
 19    import java.util.*;
 20   
 21    import org.omwg.logicalexpression.*;
 22    import org.omwg.logicalexpression.terms.*;
 23    import org.wsmo.factory.*;
 24   
 25   
 26    /**
 27    * <pre>
 28    *
 29    * Created on Jun 20, 2005
 30    * Committed by $Author$
 31    *
 32    * </pre>
 33    *
 34    * @author holger.lausen@deri.org
 35    * @version $Revision$ $Date$
 36    * @see org.omwg.logexpression.LogicalExpressionFactory
 37    */
 38    public abstract class AbstractLogicalExpressionFactoryImpl
 39    implements LogicalExpressionFactory {
 40   
 41    /**
 42    * @see LogicalExpressionFactory#createAttribusteValues(Term, Term, List)
 43    */
 44  0 public CompoundMolecule createAttribusteValues(Term instanceID, Term attributeID, List attributeValues) throws IllegalArgumentException {
 45  0 if (attributeValues == null){
 46  0 throw new IllegalArgumentException("list of attribute values must contain at least 2 terms");
 47    }
 48  0 List <Molecule> molecules = new Vector <Molecule>();
 49  0 Iterator i = attributeValues.iterator();
 50  0 while (i.hasNext()){
 51  0 Term term;
 52  0 try{
 53  0 term=(Term)i.next();
 54    }catch (ClassCastException e){
 55  0 throw new IllegalArgumentException("list of attribute values can only contain terms");
 56    }
 57  0 molecules.add(createAttributeValue(instanceID,attributeID, term));
 58    }
 59  0 return createCompoundMolecule(molecules);
 60    }
 61   
 62    /**
 63    * @see LogicalExpressionFactory#createAttributeConstraints(Term, Term, List)
 64    */
 65  0 public CompoundMolecule createAttributeConstraints(Term instanceID, Term attributeID, List attributeTypes) throws IllegalArgumentException {
 66  0 if (attributeTypes == null){
 67  0 throw new IllegalArgumentException("list of attribute types must contain at least 2 term");
 68    }
 69  0 List <Molecule> molecules = new Vector <Molecule> ();
 70  0 Iterator i = attributeTypes.iterator();
 71  0 while (i.hasNext()){
 72  0 Term term;
 73  0 try{
 74  0 term=(Term)i.next();
 75    }catch (ClassCastException e){
 76  0 throw new IllegalArgumentException("list of attribute types can only contain terms");
 77    }
 78  0 molecules.add(createAttributeConstraint(instanceID,attributeID, term));
 79    }
 80  0 return createCompoundMolecule(molecules);
 81    }
 82   
 83    /**
 84    * @see LogicalExpressionFactory#createAttributeInferences(Term, Term, List)
 85    */
 86  0 public CompoundMolecule createAttributeInferences(Term instanceID, Term attributeID, List attributeTypes) throws IllegalArgumentException {
 87  0 if (attributeTypes == null){
 88  0 throw new IllegalArgumentException("list of attribute types must contain at least 2 term");
 89    }
 90  0 List <Molecule> molecules = new Vector <Molecule> ();
 91  0 Iterator i = attributeTypes.iterator();
 92  0 while (i.hasNext()){
 93  0 Term term;
 94  0 try{
 95  0 term=(Term)i.next();
 96    }catch (ClassCastException e){
 97  0 throw new IllegalArgumentException("list of attribute types can only contain terms");
 98    }
 99  0 molecules.add(createAttributeInference(instanceID,attributeID, term));
 100    }
 101  0 return createCompoundMolecule(molecules);
 102    }
 103   
 104    /**
 105    * @see LogicalExpressionFactory#createMemberShipMolecules(Term, List)
 106    */
 107  0 public CompoundMolecule createMemberShipMolecules(Term identifier, List concepts){
 108  0 if (concepts == null){
 109  0 throw new IllegalArgumentException("list of concepts must contain at least 2 terms");
 110    }
 111  0 List <Molecule> molecules = new Vector <Molecule> ();
 112  0 Iterator i = concepts.iterator();
 113  0 while (i.hasNext()){
 114  0 Term concept;
 115  0 try{
 116  0 concept=(Term)i.next();
 117    }catch (ClassCastException e){
 118  0 throw new IllegalArgumentException("list of concept ids can only contain terms");
 119    }
 120  0 molecules.add(createMemberShipMolecule(identifier, concept));
 121    }
 122  0 return createCompoundMolecule(molecules);
 123    }
 124   
 125    /**
 126    * @see LogicalExpressionFactory#createSubConceptMolecules(Term, List)
 127    */
 128  0 public CompoundMolecule createSubConceptMolecules(Term identifier, List concepts){
 129  0 if (concepts == null){
 130  0 throw new IllegalArgumentException("list of concepts must contain at least 2 terms");
 131    }
 132  0 List <Molecule> molecules = new Vector <Molecule> ();
 133  0 Iterator i = concepts.iterator();
 134  0 while (i.hasNext()){
 135  0 Term concept;
 136  0 try{
 137  0 concept=(Term)i.next();
 138    }catch (ClassCastException e){
 139  0 throw new IllegalArgumentException("list of concept ids can only contain terms");
 140    }
 141  0 molecules.add(createSubConceptMolecule(identifier, concept));
 142    }
 143  0 return createCompoundMolecule(molecules);
 144    }
 145   
 146   
 147    }
 148   
 149    /*
 150    * $Log$
 151    * Revision 1.2 2007/04/02 12:13:24 morcen
 152    * Generics support added to wsmo-api, wsmo4j and wsmo-test
 153    *
 154    * Revision 1.1 2006/02/16 19:40:27 holgerlausen
 155    * added convinience methods to logical expression factory:
 156    * RFE 113501
 157    *
 158    */