EMMA Coverage Report (generated Thu Nov 26 15:54:18 CST 2009)
[all classes][org.eclipse.pde.api.tools.internal.comparator]

COVERAGE SUMMARY FOR SOURCE FILE [TypeParameterDescriptor.java]

nameclass, %method, %block, %line, %
TypeParameterDescriptor.java100% (1/1)75%  (3/4)32%  (29/92)46%  (11/24)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TypeParameterDescriptor100% (1/1)75%  (3/4)32%  (29/92)46%  (11/24)
toString (): String 0%   (0/1)0%   (0/63)0%   (0/13)
TypeParameterDescriptor (String): void 100% (1/1)100% (6/6)100% (3/3)
addInterfaceBound (String): void 100% (1/1)100% (14/14)100% (4/4)
setClassBound (String): void 100% (1/1)100% (9/9)100% (4/4)

1/*******************************************************************************
2 * Copyright (c) 2007, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 *     IBM Corporation - initial API and implementation
10 *******************************************************************************/
11package org.eclipse.pde.api.tools.internal.comparator;
12 
13import java.util.ArrayList;
14import java.util.Iterator;
15import java.util.List;
16 
17import org.eclipse.pde.api.tools.internal.util.Util;
18 
19/**
20 * Represents a type parameter inside a generic signature
21 */
22class TypeParameterDescriptor {
23        private static final String JAVA_LANG_OBJECT = "java.lang.Object"; //$NON-NLS-1$
24        String classBound;
25        List interfaceBounds;
26        String name;
27 
28        public TypeParameterDescriptor(String name) {
29                this.name = name;
30        }
31 
32        public void addInterfaceBound(String bound) {
33                if (this.interfaceBounds == null) {
34                        this.interfaceBounds = new ArrayList();
35                }
36                this.interfaceBounds.add(bound);
37        }
38        
39        public void setClassBound(String bound) {
40                if (JAVA_LANG_OBJECT.equals(bound)) {
41                        // we consider Object as an implicit bound
42                        // <E> is implicitly <E extends Object>
43                        return;
44                }
45                this.classBound = bound;
46        }
47        
48        public String toString() {
49                StringBuffer buffer = new StringBuffer();
50                buffer.append("type parameter ").append(this.name).append(" : ").append(Util.LINE_DELIMITER); //$NON-NLS-1$ //$NON-NLS-2$
51                if (this.classBound != null) {
52                        buffer.append("class bound : ").append(this.classBound).append(Util.LINE_DELIMITER); //$NON-NLS-1$
53                }
54                if (this.interfaceBounds != null) {
55                        buffer.append("interface bounds : "); //$NON-NLS-1$
56                        int i = 0;
57                        for (Iterator iterator = this.interfaceBounds.iterator(); iterator.hasNext(); ) {
58                                if (i > 0) buffer.append(',');
59                                i++;
60                                buffer.append(iterator.next());
61                        }
62                        buffer.append(Util.LINE_DELIMITER);
63                }
64                return String.valueOf(buffer);
65        }
66}

[all classes][org.eclipse.pde.api.tools.internal.comparator]
EMMA 2.0.5312 EclEmma Fix 1 (C) Vladimir Roubtsov