KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > core > FeaturePlugin


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.update.internal.core;
12 import org.eclipse.update.core.*;
13 /**
14  * An IPluginEntry - IFeature pair.
15  * The IFeature is a featue or a patch wich delivered the plugin
16  */

17 public class FeaturePlugin {
18     private IPluginEntry pluginEntry;
19     private IFeature feature;
20     public FeaturePlugin(IPluginEntry entry, IFeature feature) {
21         pluginEntry = entry;
22         this.feature = feature;
23     }
24     public IPluginEntry getEntry() {
25         return pluginEntry;
26     }
27     public IFeature getFeature() {
28         return feature;
29     }
30     /**
31      * Plugins are equal if their IDs and versions are the same.
32      */

33     public boolean equals(Object JavaDoc o) {
34         if (o instanceof FeaturePlugin) {
35             FeaturePlugin p = (FeaturePlugin) o;
36             return getEntry().getVersionedIdentifier().equals(p.getEntry().getVersionedIdentifier());
37         }
38         return false;
39     }
40     public int hashCode() {
41         return getEntry().getVersionedIdentifier().hashCode();
42     }
43     public String JavaDoc toString() {
44         return pluginEntry + " in " + feature; //$NON-NLS-1$
45
}
46 }
47
Popular Tags