Coverage report

  %line %branch
net.sf.infrared.web.treecontrolmodel.IRIntermediateNode
0% 
0% 

 1  
 /*
 2  
  *
 3  
  * Copyright 2005 Tavant Technologies and Contributors
 4  
  * 
 5  
  * Licensed under the Apache License, Version 2.0 (the "License")
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  *
 9  
  *     http://www.apache.org/licenses/LICENSE-2.0
 10  
  *
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  *
 17  
  *
 18  
  *
 19  
  * Original Author:  prashant.nair (Tavant Technologies)
 20  
  * Contributor(s):   -;
 21  
  *
 22  
  */
 23  
 package net.sf.infrared.web.treecontrolmodel;
 24  
 
 25  
 import java.util.ArrayList;
 26  
 import java.util.List;
 27  
 
 28  
 import net.sf.infrared.base.model.AggregateExecutionTime;
 29  
 import net.sf.infrared.base.util.TreeNode;
 30  
 
 31  
 public class IRIntermediateNode implements net.sf.jsptree.tree.TreeNode {
 32  
 	public TreeNode node;
 33  
 
 34  
 	public NodeToStringConverter nodeToStringConverter;
 35  
 
 36  
 	private AggrApiJspTreeNode treeNode;
 37  
 
 38  
 	private List children;
 39  
 
 40  0
 	public IRIntermediateNode(TreeNode node, NodeToStringConverter nodeToStringConverter) {
 41  0
 		this.node = node;
 42  0
 		this.nodeToStringConverter = nodeToStringConverter;
 43  0
 		treeNode = new AggrApiJspTreeNode((AggregateExecutionTime) node.getValue()
 44  
 												,nodeToStringConverter);
 45  0
 		children = new ArrayList();
 46  0
 	}
 47  
 
 48  
 	public Object getData() {
 49  0
 		return treeNode;
 50  
 	}
 51  
 
 52  
 	public List getChildNodes() {
 53  0
 		List nodeList = node.getChildren();
 54  
 		// We do not want to rebuild the tree again for the same node.
 55  0
 		if (children.size() == 0) {
 56  0
 			for (int i = 0; i < nodeList.size(); i++) {
 57  0
 				net.sf.infrared.base.util.TreeNode childNode = 
 58  
 									(net.sf.infrared.base.util.TreeNode) nodeList.get(i);
 59  0
 				if (childNode.getChildren().size() == 0) {
 60  0
 					AggregateExecutionTime aggApiTime = (AggregateExecutionTime) childNode
 61  
 																				.getValue();
 62  0
 						children.add(new IRLeafNode(childNode,nodeToStringConverter));
 63  
 				} 
 64  
 				else {
 65  0
 					children.add(new IRIntermediateNode(childNode,nodeToStringConverter));
 66  
 				}
 67  
 			}
 68  
 		}
 69  0
 		return children;
 70  
 	}
 71  
 
 72  
 	public int getDepth() {
 73  0
 		return node.getDepth();
 74  
 	}
 75  
 
 76  
 	public boolean hasChildren() {
 77  0
 		if (node.getChildren().size() > 0)
 78  0
 			return true;
 79  
 		else
 80  0
 			return false;
 81  
 	}
 82  
 
 83  
 	public int getChildCount() {
 84  0
 		return node.getChildren().size();
 85  
 	}
 86  
 
 87  
 	public Object clone() throws CloneNotSupportedException {
 88  0
 		return (IRIntermediateNode) super.clone();
 89  
 	}
 90  
 
 91  
 	public int hashCode() {
 92  0
 		return treeNode.hashCode();
 93  
 	}
 94  
 
 95  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.