Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 4996ba75f6f8cf72753d34ef2eed9bc066b8c77a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*******************************************************************************
 * Copyright (c) 2000, 2012 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.osgi.framework.util;

/**
 * An element of an <code>KeyedHashSet</code>.  A KeyedElement privides the key which is used to hash 
 * the elements in an <code>KeyedHashSet</code>.
 * @see KeyedHashSet
 * @since 3.2
 */
// This class was moved from  /org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/KeyedElement.java
public interface KeyedElement {
	/**
	 * Returns the hash code of the key
	 * @return the hash code of the key
	 */
	public int getKeyHashCode();

	/**
	 * Compares this element with a specified element
	 * @param other the element to compare with
	 * @return returns true if the specified element equals this element
	 */
	public boolean compare(KeyedElement other);

	/**
	 * Returns the key for this element
	 * @return the key for this element
	 */
	public Object getKey();
}

Back to the top