KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > python > core > WeakInternalTables


1 // Copyright 2000 Samuele Pedroni
2

3 package org.python.core;
4
5 import java.lang.ref.*;
6 import java.util.*;
7
8 public class WeakInternalTables extends AutoInternalTables {
9
10     private static class Ref extends WeakReference {
11         Object JavaDoc key;
12         short type;
13
14         Ref(short type,Object JavaDoc key, Object JavaDoc obj, ReferenceQueue queue) {
15             super(obj,queue);
16             this.type=type;
17             this.key=key;
18         }
19     }
20
21     protected Reference newAutoRef(short type,Object JavaDoc key, Object JavaDoc obj) {
22         return new Ref(type,key,obj,queue);
23     }
24
25     protected short getAutoRefType(Reference ref) {
26         return ((Ref)ref).type;
27     }
28
29
30     protected Object JavaDoc getAutoRefKey(Reference ref) {
31         return ((Ref)ref).key;
32     }
33
34 }
35
Popular Tags