KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > internal > resolver > VersionConstraintImpl


1 /*******************************************************************************
2  * Copyright (c) 2003, 2005 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  *******************************************************************************/

11 package org.eclipse.osgi.internal.resolver;
12
13 import org.eclipse.osgi.service.resolver.*;
14
15 public abstract class VersionConstraintImpl implements VersionConstraint {
16     private String JavaDoc name;
17     private VersionRange versionRange;
18     private BundleDescription bundle;
19     private BaseDescription supplier;
20
21     public String JavaDoc getName() {
22         return name;
23     }
24
25     public VersionRange getVersionRange() {
26         if (versionRange == null)
27             return VersionRange.emptyRange;
28         return versionRange;
29     }
30
31     public BundleDescription getBundle() {
32         return bundle;
33     }
34
35     public boolean isResolved() {
36         return supplier != null;
37     }
38
39     public BaseDescription getSupplier() {
40         return supplier;
41     }
42
43     public boolean isSatisfiedBy(BaseDescription supplier) {
44         return false;
45     }
46     protected void setName(String JavaDoc name) {
47         this.name = name;
48     }
49
50     protected void setVersionRange(VersionRange versionRange) {
51         this.versionRange = versionRange;
52     }
53
54     protected void setBundle(BundleDescription bundle) {
55         this.bundle = bundle;
56     }
57
58     protected void setSupplier(BaseDescription supplier) {
59         this.supplier = supplier;
60     }
61 }
62
Popular Tags