Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ref/KeyedPhantomReference.java')
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ref/KeyedPhantomReference.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ref/KeyedPhantomReference.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ref/KeyedPhantomReference.java
new file mode 100644
index 0000000000..d75c8fa1e2
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ref/KeyedPhantomReference.java
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.util.ref;
+
+import java.lang.ref.PhantomReference;
+import java.lang.ref.ReferenceQueue;
+
+/**
+ * @author Eike Stepper
+ */
+public class KeyedPhantomReference<K, T> extends PhantomReference<T> implements KeyedReference<K, T>
+{
+ private K key;
+
+ public KeyedPhantomReference(K key, T ref, ReferenceQueue<T> queue)
+ {
+ super(ref, queue);
+ this.key = key;
+ }
+
+ public ReferenceType getType()
+ {
+ return ReferenceType.PHANTOM;
+ }
+
+ public K getKey()
+ {
+ return key;
+ }
+} \ No newline at end of file

Back to the top