Clover coverage report - Ant Coverage
Coverage timestamp: Tue Apr 8 2003 20:43:55 EST
file stats: LOC: 207   Methods: 18
NCLOC: 32   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ConditionBase.java - 83.3% 83.3% 83.3%
 1   
 /*
 2   
  * The Apache Software License, Version 1.1
 3   
  *
 4   
  * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
 5   
  * reserved.
 6   
  *
 7   
  * Redistribution and use in source and binary forms, with or without
 8   
  * modification, are permitted provided that the following conditions
 9   
  * are met:
 10   
  *
 11   
  * 1. Redistributions of source code must retain the above copyright
 12   
  *    notice, this list of conditions and the following disclaimer.
 13   
  *
 14   
  * 2. Redistributions in binary form must reproduce the above copyright
 15   
  *    notice, this list of conditions and the following disclaimer in
 16   
  *    the documentation and/or other materials provided with the
 17   
  *    distribution.
 18   
  *
 19   
  * 3. The end-user documentation included with the redistribution, if
 20   
  *    any, must include the following acknowlegement:
 21   
  *       "This product includes software developed by the
 22   
  *        Apache Software Foundation (http://www.apache.org/)."
 23   
  *    Alternately, this acknowlegement may appear in the software itself,
 24   
  *    if and wherever such third-party acknowlegements normally appear.
 25   
  *
 26   
  * 4. The names "Ant" and "Apache Software
 27   
  *    Foundation" must not be used to endorse or promote products derived
 28   
  *    from this software without prior written permission. For written
 29   
  *    permission, please contact apache@apache.org.
 30   
  *
 31   
  * 5. Products derived from this software may not be called "Apache"
 32   
  *    nor may "Apache" appear in their names without prior written
 33   
  *    permission of the Apache Group.
 34   
  *
 35   
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 36   
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 37   
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 38   
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 39   
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 40   
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 41   
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 42   
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 43   
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 44   
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 45   
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 46   
  * SUCH DAMAGE.
 47   
  * ====================================================================
 48   
  *
 49   
  * This software consists of voluntary contributions made by many
 50   
  * individuals on behalf of the Apache Software Foundation.  For more
 51   
  * information on the Apache Software Foundation, please see
 52   
  * <http://www.apache.org/>.
 53   
  */
 54   
 
 55   
 package org.apache.tools.ant.taskdefs.condition;
 56   
 
 57   
 import java.util.Enumeration;
 58   
 import java.util.Vector;
 59   
 import org.apache.tools.ant.ProjectComponent;
 60   
 import org.apache.tools.ant.taskdefs.Available;
 61   
 import org.apache.tools.ant.taskdefs.Checksum;
 62   
 import org.apache.tools.ant.taskdefs.UpToDate;
 63   
 
 64   
 /**
 65   
  * Baseclass for the &lt;condition&gt; task as well as several
 66   
  * conditions - ensures that the types of conditions inside the task
 67   
  * and the "container" conditions are in sync.
 68   
  *
 69   
  * @author Stefan Bodewig
 70   
  * @since Ant 1.4
 71   
  * @version $Revision: 1.18 $
 72   
  */
 73   
 public abstract class ConditionBase extends ProjectComponent {
 74   
     private Vector conditions = new Vector();
 75   
 
 76   
     /**
 77   
      * Count the conditions.
 78   
      *
 79   
      * @since 1.1
 80   
      */
 81  138
     protected int countConditions() {
 82  138
         return conditions.size();
 83   
     }
 84   
 
 85   
     /**
 86   
      * Iterate through all conditions.
 87   
      *
 88   
      * @since 1.1
 89   
      */
 90  94
     protected final Enumeration getConditions() {
 91  94
         return conditions.elements();
 92   
     }
 93   
 
 94   
     /**
 95   
      * Add an &lt;available&gt; condition.
 96   
      *
 97   
      * @since 1.1
 98   
      */
 99  18
     public void addAvailable(Available a) {conditions.addElement(a);}
 100   
 
 101   
     /**
 102   
      * Add an &lt;checksum&gt; condition.
 103   
      *
 104   
      * @since 1.4, Ant 1.5
 105   
      */
 106  2
     public void addChecksum(Checksum c) {conditions.addElement(c);}
 107   
 
 108   
     /**
 109   
      * Add an &lt;uptodate&gt; condition.
 110   
      *
 111   
      * @since 1.1
 112   
      */
 113  0
     public void addUptodate(UpToDate u) {conditions.addElement(u);}
 114   
 
 115   
     /**
 116   
      * Add an &lt;not&gt; condition "container".
 117   
      *
 118   
      * @since 1.1
 119   
      */
 120  5
     public void addNot(Not n) {conditions.addElement(n);}
 121   
 
 122   
     /**
 123   
      * Add an &lt;and&gt; condition "container".
 124   
      *
 125   
      * @since 1.1
 126   
      */
 127  15
     public void addAnd(And a) {conditions.addElement(a);}
 128   
 
 129   
     /**
 130   
      * Add an &lt;or&gt; condition "container".
 131   
      *
 132   
      * @since 1.1
 133   
      */
 134  14
     public void addOr(Or o) {conditions.addElement(o);}
 135   
 
 136   
     /**
 137   
      * Add an &lt;equals&gt; condition.
 138   
      *
 139   
      * @since 1.1
 140   
      */
 141  23
     public void addEquals(Equals e) {conditions.addElement(e);}
 142   
 
 143   
     /**
 144   
      * Add an &lt;os&gt; condition.
 145   
      *
 146   
      * @since 1.1
 147   
      */
 148  0
     public void addOs(Os o) {conditions.addElement(o);}
 149   
 
 150   
     /**
 151   
      * Add an &lt;isset&gt; condition.
 152   
      *
 153   
      * @since Ant 1.5
 154   
      */
 155  15
     public void addIsSet(IsSet i) {conditions.addElement(i);}
 156   
 
 157   
     /**
 158   
      * Add an &lt;http&gt; condition.
 159   
      *
 160   
      * @since Ant 1.5
 161   
      */
 162  1
     public void addHttp(Http h) {conditions.addElement(h);}
 163   
 
 164   
     /**
 165   
      * Add a &lt;socket&gt; condition.
 166   
      *
 167   
      * @since Ant 1.5
 168   
      */
 169  0
     public void addSocket(Socket s) {conditions.addElement(s);}
 170   
 
 171   
     /**
 172   
      * Add a &lt;filesmatch&gt; condition.
 173   
      *
 174   
      * @since Ant 1.5
 175   
      */
 176  8
     public void addFilesMatch(FilesMatch test) {conditions.addElement(test);}
 177   
     
 178   
     /**
 179   
      * Add a &lt;contains&gt; condition.
 180   
      *
 181   
      * @since Ant 1.5
 182   
      */
 183  7
     public void addContains(Contains test) {conditions.addElement(test);}
 184   
 
 185   
     /**
 186   
      * Add a &lt;istrue&gt; condition.
 187   
      *
 188   
      * @since Ant 1.5
 189   
      */
 190  10
     public void addIsTrue(IsTrue test) {conditions.addElement(test);}
 191   
 
 192   
     /**
 193   
      * Add a &lt;isfalse&gt; condition.
 194   
      *
 195   
      * @since Ant 1.5
 196   
      */
 197  4
     public void addIsFalse(IsFalse test) {conditions.addElement(test);}
 198   
       
 199   
     /**
 200   
      * Add an &lt;isreference&gt; condition.
 201   
      *
 202   
      * @since Ant 1.6
 203   
      */
 204  7
     public void addIsReference(IsReference i) {conditions.addElement(i);}
 205   
 
 206   
 }
 207