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

COVERAGE SUMMARY FOR SOURCE FILE [BundleVersionRange.java]

nameclass, %method, %block, %line, %
BundleVersionRange.java100% (1/1)40%  (4/10)51%  (32/63)59%  (10/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BundleVersionRange100% (1/1)40%  (4/10)51%  (32/63)59%  (10/17)
getMaximumVersion (): String 0%   (0/1)0%   (0/5)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/4)0%   (0/1)
isIncludeMaximum (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
isIncludeMinimum (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
isIncluded (String): boolean 0%   (0/1)0%   (0/8)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/4)0%   (0/1)
equals (Object): boolean 100% (1/1)86%  (12/14)75%  (3/4)
BundleVersionRange (String): void 100% (1/1)100% (9/9)100% (3/3)
BundleVersionRange (VersionRange): void 100% (1/1)100% (6/6)100% (3/3)
getMinimumVersion (): String 100% (1/1)100% (5/5)100% (1/1)

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;
12 
13import org.eclipse.osgi.service.resolver.VersionRange;
14import org.eclipse.pde.api.tools.internal.provisional.IVersionRange;
15import org.osgi.framework.Version;
16 
17/**
18 * Implementation of a required component description based on
19 * OSGi bundles.
20 * 
21 * @since 1.0.0
22 */
23public class BundleVersionRange implements IVersionRange {
24        
25        private VersionRange fRange;
26        
27        
28        /**
29         * Constructs a new version range based on the given
30         * required bundle version interval. 
31         * 
32         * @param versionInterval string representing mathematical interval
33         *  describing range of compatible versions
34         */
35        public BundleVersionRange(String versionInterval) {
36                fRange = new VersionRange(versionInterval);
37        }
38        
39        /**
40         * Constructs a new version range based on the given range.
41         * 
42         * @param range version range
43         */        
44        public BundleVersionRange(VersionRange range) {
45                fRange = range;
46        }
47 
48        /* (non-Javadoc)
49         * @see org.eclipse.pde.api.tools.manifest.IRequiredComponentDescription#getMaximumVersion()
50         */
51        public String getMaximumVersion() {
52                return fRange.getMaximum().toString();
53        }
54 
55        /* (non-Javadoc)
56         * @see org.eclipse.pde.api.tools.manifest.IRequiredComponentDescription#getMinimumVersion()
57         */
58        public String getMinimumVersion() {
59                return fRange.getMinimum().toString();
60        }
61 
62        /* (non-Javadoc)
63         * @see org.eclipse.pde.api.tools.manifest.IRequiredComponentDescription#isIncludeMaximum()
64         */
65        public boolean isIncludeMaximum() {
66                return fRange.getIncludeMaximum();
67        }
68 
69        /* (non-Javadoc)
70         * @see org.eclipse.pde.api.tools.manifest.IRequiredComponentDescription#isIncludeMinimum()
71         */
72        public boolean isIncludeMinimum() {
73                return fRange.getIncludeMinimum();
74        }
75 
76        public boolean equals(Object obj) {
77                if (obj instanceof BundleVersionRange) {
78                        BundleVersionRange range = (BundleVersionRange) obj;
79                        return fRange.equals(range.fRange);
80                }
81                return false;
82        }
83        
84        /* (non-Javadoc)
85         * @see java.lang.Object#hashCode()
86         */
87        public int hashCode() {
88                return fRange.hashCode();
89        }
90 
91        public String toString() {
92                return fRange.toString();
93        }
94 
95        /* (non-Javadoc)
96         * @see org.eclipse.pde.api.tools.manifest.IVersionRange#isIncluded(java.lang.String)
97         */
98        public boolean isIncluded(String version) {
99                return fRange.isIncluded(new Version(version));
100        }
101        
102        
103        
104        
105 
106}

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