Home | History | Annotate | Download | only in base
      1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      2 <!--NewPage-->
      3 <HTML>
      4 <HEAD>
      5 <!-- Generated by javadoc (build 1.6.0-google-internal) on Mon Jan 04 20:47:56 PST 2010 -->
      6 <TITLE>
      7 FinalizablePhantomReference (Guava Libraries 2010.01.04)
      8 </TITLE>
      9 
     10 <META NAME="date" CONTENT="2010-01-04">
     11 
     12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
     13 
     14 <SCRIPT type="text/javascript">
     15 function windowTitle()
     16 {
     17     if (location.href.indexOf('is-external=true') == -1) {
     18         parent.document.title="FinalizablePhantomReference (Guava Libraries 2010.01.04)";
     19     }
     20 }
     21 </SCRIPT>
     22 <NOSCRIPT>
     23 </NOSCRIPT>
     24 
     25 </HEAD>
     26 
     27 <BODY BGCOLOR="white" onload="windowTitle();">
     28 <HR>
     29 
     30 
     31 <!-- ========= START OF TOP NAVBAR ======= -->
     32 <A NAME="navbar_top"><!-- --></A>
     33 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
     34 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
     35 <TR>
     36 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
     37 <A NAME="navbar_top_firstrow"><!-- --></A>
     38 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
     39   <TR ALIGN="center" VALIGN="top">
     40   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
     41   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
     42   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
     43   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/FinalizablePhantomReference.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
     44   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
     45   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
     46   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
     47   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
     48   </TR>
     49 </TABLE>
     50 </TD>
     51 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
     52 </EM>
     53 </TD>
     54 </TR>
     55 
     56 <TR>
     57 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
     58 &nbsp;<A HREF="../../../../com/google/common/base/Defaults.html" title="class in com.google.common.base"><B>PREV CLASS</B></A>&nbsp;
     59 &nbsp;<A HREF="../../../../com/google/common/base/FinalizableReference.html" title="interface in com.google.common.base"><B>NEXT CLASS</B></A></FONT></TD>
     60 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
     61   <A HREF="../../../../index.html?com/google/common/base/FinalizablePhantomReference.html" target="_top"><B>FRAMES</B></A>  &nbsp;
     62 &nbsp;<A HREF="FinalizablePhantomReference.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
     63 &nbsp;<SCRIPT type="text/javascript">
     64   <!--
     65   if(window==top) {
     66     document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
     67   }
     68   //-->
     69 </SCRIPT>
     70 <NOSCRIPT>
     71   <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
     72 </NOSCRIPT>
     73 
     74 
     75 </FONT></TD>
     76 </TR>
     77 <TR>
     78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
     79   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_java.lang.ref.PhantomReference">METHOD</A></FONT></TD>
     80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
     81 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD>
     82 </TR>
     83 </TABLE>
     84 <A NAME="skip-navbar_top"></A>
     85 <!-- ========= END OF TOP NAVBAR ========= -->
     86 
     87 <HR>
     88 <!-- ======== START OF CLASS DATA ======== -->
     89 <H2>
     90 <FONT SIZE="-1">
     91 com.google.common.base</FONT>
     92 <BR>
     93 Class FinalizablePhantomReference&lt;T&gt;</H2>
     94 <PRE>
     95 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
     96   <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/Reference.html?is-external=true" title="class or interface in java.lang.ref">java.lang.ref.Reference</A>&lt;T&gt;
     97       <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/PhantomReference.html?is-external=true" title="class or interface in java.lang.ref">java.lang.ref.PhantomReference</A>&lt;T&gt;
     98           <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.base.FinalizablePhantomReference&lt;T&gt;</B>
     99 </PRE>
    100 <DL>
    101 <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../com/google/common/base/FinalizableReference.html" title="interface in com.google.common.base">FinalizableReference</A></DD>
    102 </DL>
    103 <HR>
    104 <DL>
    105 <DT><PRE>public abstract class <B>FinalizablePhantomReference&lt;T&gt;</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/PhantomReference.html?is-external=true" title="class or interface in java.lang.ref">PhantomReference</A>&lt;T&gt;<DT>implements <A HREF="../../../../com/google/common/base/FinalizableReference.html" title="interface in com.google.common.base">FinalizableReference</A></DL>
    106 </PRE>
    107 
    108 <P>
    109 Phantom reference with a <code>finalizeReferent()</code> method which a
    110  background thread invokes after the garbage collector reclaims the
    111  referent. This is a simpler alternative to using a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/ReferenceQueue.html?is-external=true" title="class or interface in java.lang.ref"><CODE>ReferenceQueue</CODE></A>.
    112 
    113  <p>Unlike a normal phantom reference, this reference will be cleared
    114  automatically.
    115 <P>
    116 
    117 <P>
    118 <DL>
    119 <DT><B>Since:</B></DT>
    120   <DD>2010.01.04 <b>stable</b> (imported from Google Collections Library)</DD>
    121 <DT><B>Author:</B></DT>
    122   <DD>Bob Lee</DD>
    123 </DL>
    124 <HR>
    125 
    126 <P>
    127 
    128 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
    129 
    130 <A NAME="constructor_summary"><!-- --></A>
    131 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    132 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    133 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
    134 <B>Constructor Summary</B></FONT></TH>
    135 </TR>
    136 <TR BGCOLOR="white" CLASS="TableRowColor">
    137 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    138 <CODE>protected </CODE></FONT></TD>
    139 <TD><CODE><B><A HREF="../../../../com/google/common/base/FinalizablePhantomReference.html#FinalizablePhantomReference(T, com.google.common.base.FinalizableReferenceQueue)">FinalizablePhantomReference</A></B>(<A HREF="../../../../com/google/common/base/FinalizablePhantomReference.html" title="type parameter in FinalizablePhantomReference">T</A>&nbsp;referent,
    140                             <A HREF="../../../../com/google/common/base/FinalizableReferenceQueue.html" title="class in com.google.common.base">FinalizableReferenceQueue</A>&nbsp;queue)</CODE>
    141 
    142 <BR>
    143 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new finalizable phantom reference.</TD>
    144 </TR>
    145 </TABLE>
    146 &nbsp;
    147 <!-- ========== METHOD SUMMARY =========== -->
    148 
    149 <A NAME="method_summary"><!-- --></A>
    150 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    151 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    152 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
    153 <B>Method Summary</B></FONT></TH>
    154 </TR>
    155 </TABLE>
    156 &nbsp;<A NAME="methods_inherited_from_class_java.lang.ref.PhantomReference"><!-- --></A>
    157 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    158 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
    159 <TH ALIGN="left"><B>Methods inherited from class java.lang.ref.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/PhantomReference.html?is-external=true" title="class or interface in java.lang.ref">PhantomReference</A></B></TH>
    160 </TR>
    161 <TR BGCOLOR="white" CLASS="TableRowColor">
    162 <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/PhantomReference.html?is-external=true#get()" title="class or interface in java.lang.ref">get</A></CODE></TD>
    163 </TR>
    164 </TABLE>
    165 &nbsp;<A NAME="methods_inherited_from_class_java.lang.ref.Reference"><!-- --></A>
    166 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    167 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
    168 <TH ALIGN="left"><B>Methods inherited from class java.lang.ref.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/Reference.html?is-external=true" title="class or interface in java.lang.ref">Reference</A></B></TH>
    169 </TR>
    170 <TR BGCOLOR="white" CLASS="TableRowColor">
    171 <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/Reference.html?is-external=true#clear()" title="class or interface in java.lang.ref">clear</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/Reference.html?is-external=true#enqueue()" title="class or interface in java.lang.ref">enqueue</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/Reference.html?is-external=true#isEnqueued()" title="class or interface in java.lang.ref">isEnqueued</A></CODE></TD>
    172 </TR>
    173 </TABLE>
    174 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
    175 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    176 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
    177 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
    178 </TR>
    179 <TR BGCOLOR="white" CLASS="TableRowColor">
    180 <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
    181 </TR>
    182 </TABLE>
    183 &nbsp;<A NAME="methods_inherited_from_class_com.google.common.base.FinalizableReference"><!-- --></A>
    184 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    185 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
    186 <TH ALIGN="left"><B>Methods inherited from interface com.google.common.base.<A HREF="../../../../com/google/common/base/FinalizableReference.html" title="interface in com.google.common.base">FinalizableReference</A></B></TH>
    187 </TR>
    188 <TR BGCOLOR="white" CLASS="TableRowColor">
    189 <TD><CODE><A HREF="../../../../com/google/common/base/FinalizableReference.html#finalizeReferent()">finalizeReferent</A></CODE></TD>
    190 </TR>
    191 </TABLE>
    192 &nbsp;
    193 <P>
    194 
    195 <!-- ========= CONSTRUCTOR DETAIL ======== -->
    196 
    197 <A NAME="constructor_detail"><!-- --></A>
    198 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    199 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    200 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
    201 <B>Constructor Detail</B></FONT></TH>
    202 </TR>
    203 </TABLE>
    204 
    205 <A NAME="FinalizablePhantomReference(java.lang.Object,com.google.common.base.FinalizableReferenceQueue)"><!-- --></A><A NAME="FinalizablePhantomReference(T, com.google.common.base.FinalizableReferenceQueue)"><!-- --></A><H3>
    206 FinalizablePhantomReference</H3>
    207 <PRE>
    208 protected <B>FinalizablePhantomReference</B>(<A HREF="../../../../com/google/common/base/FinalizablePhantomReference.html" title="type parameter in FinalizablePhantomReference">T</A>&nbsp;referent,
    209                                       <A HREF="../../../../com/google/common/base/FinalizableReferenceQueue.html" title="class in com.google.common.base">FinalizableReferenceQueue</A>&nbsp;queue)</PRE>
    210 <DL>
    211 <DD>Constructs a new finalizable phantom reference.
    212 <P>
    213 <DL>
    214 <DT><B>Parameters:</B><DD><CODE>referent</CODE> - to phantom reference<DD><CODE>queue</CODE> - that should finalize the referent</DL>
    215 </DL>
    216 <!-- ========= END OF CLASS DATA ========= -->
    217 <HR>
    218 
    219 
    220 <!-- ======= START OF BOTTOM NAVBAR ====== -->
    221 <A NAME="navbar_bottom"><!-- --></A>
    222 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
    223 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
    224 <TR>
    225 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
    226 <A NAME="navbar_bottom_firstrow"><!-- --></A>
    227 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
    228   <TR ALIGN="center" VALIGN="top">
    229   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
    230   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
    231   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
    232   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/FinalizablePhantomReference.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
    233   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
    234   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
    235   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
    236   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
    237   </TR>
    238 </TABLE>
    239 </TD>
    240 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
    241 </EM>
    242 </TD>
    243 </TR>
    244 
    245 <TR>
    246 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    247 &nbsp;<A HREF="../../../../com/google/common/base/Defaults.html" title="class in com.google.common.base"><B>PREV CLASS</B></A>&nbsp;
    248 &nbsp;<A HREF="../../../../com/google/common/base/FinalizableReference.html" title="interface in com.google.common.base"><B>NEXT CLASS</B></A></FONT></TD>
    249 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    250   <A HREF="../../../../index.html?com/google/common/base/FinalizablePhantomReference.html" target="_top"><B>FRAMES</B></A>  &nbsp;
    251 &nbsp;<A HREF="FinalizablePhantomReference.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
    252 &nbsp;<SCRIPT type="text/javascript">
    253   <!--
    254   if(window==top) {
    255     document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
    256   }
    257   //-->
    258 </SCRIPT>
    259 <NOSCRIPT>
    260   <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
    261 </NOSCRIPT>
    262 
    263 
    264 </FONT></TD>
    265 </TR>
    266 <TR>
    267 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
    268   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_java.lang.ref.PhantomReference">METHOD</A></FONT></TD>
    269 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
    270 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD>
    271 </TR>
    272 </TABLE>
    273 <A NAME="skip-navbar_bottom"></A>
    274 <!-- ======== END OF BOTTOM NAVBAR ======= -->
    275 
    276 <HR>
    277 
    278 </BODY>
    279 </HTML>
    280