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 FinalizableSoftReference (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="FinalizableSoftReference (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/FinalizableSoftReference.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/FinalizableReferenceQueue.html" title="class in com.google.common.base"><B>PREV CLASS</B></A>&nbsp;
     59 &nbsp;<A HREF="../../../../com/google/common/base/FinalizableWeakReference.html" title="class 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/FinalizableSoftReference.html" target="_top"><B>FRAMES</B></A>  &nbsp;
     62 &nbsp;<A HREF="FinalizableSoftReference.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.SoftReference">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 FinalizableSoftReference&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/SoftReference.html?is-external=true" title="class or interface in java.lang.ref">java.lang.ref.SoftReference</A>&lt;T&gt;
     98           <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.base.FinalizableSoftReference&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>FinalizableSoftReference&lt;T&gt;</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/SoftReference.html?is-external=true" title="class or interface in java.lang.ref">SoftReference</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 Soft reference with a <code>finalizeReferent()</code> method which a background
    110  thread invokes after the garbage collector reclaims the referent. This is a
    111  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 <P>
    113 
    114 <P>
    115 <DL>
    116 <DT><B>Since:</B></DT>
    117   <DD>2010.01.04 <b>stable</b> (imported from Google Collections Library)</DD>
    118 <DT><B>Author:</B></DT>
    119   <DD>Bob Lee</DD>
    120 </DL>
    121 <HR>
    122 
    123 <P>
    124 
    125 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
    126 
    127 <A NAME="constructor_summary"><!-- --></A>
    128 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    129 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    130 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
    131 <B>Constructor Summary</B></FONT></TH>
    132 </TR>
    133 <TR BGCOLOR="white" CLASS="TableRowColor">
    134 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    135 <CODE>protected </CODE></FONT></TD>
    136 <TD><CODE><B><A HREF="../../../../com/google/common/base/FinalizableSoftReference.html#FinalizableSoftReference(T, com.google.common.base.FinalizableReferenceQueue)">FinalizableSoftReference</A></B>(<A HREF="../../../../com/google/common/base/FinalizableSoftReference.html" title="type parameter in FinalizableSoftReference">T</A>&nbsp;referent,
    137                          <A HREF="../../../../com/google/common/base/FinalizableReferenceQueue.html" title="class in com.google.common.base">FinalizableReferenceQueue</A>&nbsp;queue)</CODE>
    138 
    139 <BR>
    140 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new finalizable soft reference.</TD>
    141 </TR>
    142 </TABLE>
    143 &nbsp;
    144 <!-- ========== METHOD SUMMARY =========== -->
    145 
    146 <A NAME="method_summary"><!-- --></A>
    147 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    148 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    149 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
    150 <B>Method Summary</B></FONT></TH>
    151 </TR>
    152 </TABLE>
    153 &nbsp;<A NAME="methods_inherited_from_class_java.lang.ref.SoftReference"><!-- --></A>
    154 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    155 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
    156 <TH ALIGN="left"><B>Methods inherited from class java.lang.ref.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/SoftReference.html?is-external=true" title="class or interface in java.lang.ref">SoftReference</A></B></TH>
    157 </TR>
    158 <TR BGCOLOR="white" CLASS="TableRowColor">
    159 <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/ref/SoftReference.html?is-external=true#get()" title="class or interface in java.lang.ref">get</A></CODE></TD>
    160 </TR>
    161 </TABLE>
    162 &nbsp;<A NAME="methods_inherited_from_class_java.lang.ref.Reference"><!-- --></A>
    163 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    164 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
    165 <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>
    166 </TR>
    167 <TR BGCOLOR="white" CLASS="TableRowColor">
    168 <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>
    169 </TR>
    170 </TABLE>
    171 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
    172 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    173 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
    174 <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>
    175 </TR>
    176 <TR BGCOLOR="white" CLASS="TableRowColor">
    177 <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>
    178 </TR>
    179 </TABLE>
    180 &nbsp;<A NAME="methods_inherited_from_class_com.google.common.base.FinalizableReference"><!-- --></A>
    181 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    182 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
    183 <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>
    184 </TR>
    185 <TR BGCOLOR="white" CLASS="TableRowColor">
    186 <TD><CODE><A HREF="../../../../com/google/common/base/FinalizableReference.html#finalizeReferent()">finalizeReferent</A></CODE></TD>
    187 </TR>
    188 </TABLE>
    189 &nbsp;
    190 <P>
    191 
    192 <!-- ========= CONSTRUCTOR DETAIL ======== -->
    193 
    194 <A NAME="constructor_detail"><!-- --></A>
    195 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    196 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    197 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
    198 <B>Constructor Detail</B></FONT></TH>
    199 </TR>
    200 </TABLE>
    201 
    202 <A NAME="FinalizableSoftReference(java.lang.Object,com.google.common.base.FinalizableReferenceQueue)"><!-- --></A><A NAME="FinalizableSoftReference(T, com.google.common.base.FinalizableReferenceQueue)"><!-- --></A><H3>
    203 FinalizableSoftReference</H3>
    204 <PRE>
    205 protected <B>FinalizableSoftReference</B>(<A HREF="../../../../com/google/common/base/FinalizableSoftReference.html" title="type parameter in FinalizableSoftReference">T</A>&nbsp;referent,
    206                                    <A HREF="../../../../com/google/common/base/FinalizableReferenceQueue.html" title="class in com.google.common.base">FinalizableReferenceQueue</A>&nbsp;queue)</PRE>
    207 <DL>
    208 <DD>Constructs a new finalizable soft reference.
    209 <P>
    210 <DL>
    211 <DT><B>Parameters:</B><DD><CODE>referent</CODE> - to softly reference<DD><CODE>queue</CODE> - that should finalize the referent</DL>
    212 </DL>
    213 <!-- ========= END OF CLASS DATA ========= -->
    214 <HR>
    215 
    216 
    217 <!-- ======= START OF BOTTOM NAVBAR ====== -->
    218 <A NAME="navbar_bottom"><!-- --></A>
    219 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
    220 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
    221 <TR>
    222 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
    223 <A NAME="navbar_bottom_firstrow"><!-- --></A>
    224 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
    225   <TR ALIGN="center" VALIGN="top">
    226   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
    227   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
    228   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
    229   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/FinalizableSoftReference.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
    230   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
    231   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
    232   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
    233   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
    234   </TR>
    235 </TABLE>
    236 </TD>
    237 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
    238 </EM>
    239 </TD>
    240 </TR>
    241 
    242 <TR>
    243 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    244 &nbsp;<A HREF="../../../../com/google/common/base/FinalizableReferenceQueue.html" title="class in com.google.common.base"><B>PREV CLASS</B></A>&nbsp;
    245 &nbsp;<A HREF="../../../../com/google/common/base/FinalizableWeakReference.html" title="class in com.google.common.base"><B>NEXT CLASS</B></A></FONT></TD>
    246 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    247   <A HREF="../../../../index.html?com/google/common/base/FinalizableSoftReference.html" target="_top"><B>FRAMES</B></A>  &nbsp;
    248 &nbsp;<A HREF="FinalizableSoftReference.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
    249 &nbsp;<SCRIPT type="text/javascript">
    250   <!--
    251   if(window==top) {
    252     document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
    253   }
    254   //-->
    255 </SCRIPT>
    256 <NOSCRIPT>
    257   <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
    258 </NOSCRIPT>
    259 
    260 
    261 </FONT></TD>
    262 </TR>
    263 <TR>
    264 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
    265   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.SoftReference">METHOD</A></FONT></TD>
    266 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
    267 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD>
    268 </TR>
    269 </TABLE>
    270 <A NAME="skip-navbar_bottom"></A>
    271 <!-- ======== END OF BOTTOM NAVBAR ======= -->
    272 
    273 <HR>
    274 
    275 </BODY>
    276 </HTML>
    277