KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > framework > util > KeyedElement


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.framework.util;
12
13 /**
14  * An element of an <code>KeyedHashSet</code>. A KeyedElement privides the key which is used to hash
15  * the elements in an <code>KeyedHashSet</code>.
16  * @see KeyedHashSet
17  * @since 3.2
18  */

19 // This class was moved from /org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/KeyedElement.java
20
public interface KeyedElement {
21     /**
22      * Returns the hash code of the key
23      * @return the hash code of the key
24      */

25     public int getKeyHashCode();
26
27     /**
28      * Compares this element with a specified element
29      * @param other the element to compare with
30      * @return returns true if the specified element equals this element
31      */

32     public boolean compare(KeyedElement other);
33
34     /**
35      * Returns the key for this element
36      * @return the key for this element
37      */

38     public Object JavaDoc getKey();
39 }
40
Popular Tags