Clover coverage report - DynamicJava Test Coverage (dynamicjava-20120303-r5436)
Coverage timestamp: Sat Mar 3 2012 03:02:19 CST
file stats: LOC: 102   Methods: 7
NCLOC: 30   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
PackageDeclaration.java 0% 36.4% 42.9% 35%
coverage coverage
 1    /*
 2    * DynamicJava - Copyright (C) 1999-2001
 3    *
 4    * Permission is hereby granted, free of charge, to any person obtaining a
 5    * copy of this software and associated documentation files
 6    * (the "Software"), to deal in the Software without restriction, including
 7    * without limitation the rights to use, copy, modify, merge, publish,
 8    * distribute, sublicense, and/or sell copies of the Software, and to permit
 9    * persons to whom the Software is furnished to do so, subject to the
 10    * following conditions:
 11    * The above copyright notice and this permission notice shall be included
 12    * in all copies or substantial portions of the Software.
 13    *
 14    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 15    * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 16    * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 17    * IN NO EVENT SHALL DYADE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 18    * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 19    * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 20    * DEALINGS IN THE SOFTWARE.
 21    *
 22    * Except as contained in this notice, the name of Dyade shall not be
 23    * used in advertising or otherwise to promote the sale, use or other
 24    * dealings in this Software without prior written authorization from
 25    * Dyade.
 26    *
 27    */
 28   
 29    package koala.dynamicjava.tree;
 30   
 31    import java.util.*;
 32   
 33    import koala.dynamicjava.tree.visitor.*;
 34   
 35    /**
 36    * This class represents the package declarations
 37    *
 38    * @author Stephane Hillion
 39    * @version 1.0 - 1999/05/13
 40    */
 41   
 42    public class PackageDeclaration extends Declaration {
 43    private String name;
 44   
 45    /**
 46    * Creates a new package declaration node
 47    * @param ident a list of tokens that represents a package name.
 48    * The list can be null.
 49    */
 50  0 public PackageDeclaration(ModifierSet mods, List<IdentifierToken> ident) {
 51  0 this(mods, ident, SourceInfo.NONE);
 52    }
 53   
 54    /**
 55    * Creates a new package declaration node
 56    * @param ident a list of tokens that represents a package name.
 57    * The list can be null.
 58    */
 59  0 public PackageDeclaration(ModifierSet mods, List<IdentifierToken> ident, SourceInfo si) {
 60  0 super(mods, si);
 61  0 name = TreeUtilities.listToName(ident);
 62    }
 63   
 64    /**
 65    * Creates a new package declaration node
 66    * @param nm a string that represents a package name.
 67    */
 68  2 public PackageDeclaration(ModifierSet mods, String nm, SourceInfo si) {
 69  2 super(mods, si);
 70  2 name = nm;
 71    }
 72   
 73    /**
 74    * Returns the name of the imported class or package
 75    */
 76  2 public String getName() {
 77  2 return name;
 78    }
 79   
 80    /**
 81    * Sets the name
 82    * @exception IllegalArgumentException if s is null
 83    */
 84  0 public void setName(String s) {
 85  0 if (s == null) throw new IllegalArgumentException("s == null");
 86  0 name = s;
 87    }
 88   
 89    /**
 90    * Allows a visitor to traverse the tree
 91    * @param visitor the visitor to accept
 92    */
 93  0 public <T> T acceptVisitor(Visitor<T> visitor) {
 94  0 return visitor.visit(this);
 95    }
 96    /**
 97    * Implementation of toString for use in unit testing
 98    */
 99  2 public String toString() {
 100  2 return "("+getClass().getName()+": "+getName()+")";
 101    }
 102    }