⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cache.html

📁 jxta的api库
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Cache(long, net.jxta.impl.util.CacheEntryListener)"><!-- --></A><H3>Cache</H3><PRE>public <B>Cache</B>(long&nbsp;maxSize,             <A HREF="../../../../net/jxta/impl/util/CacheEntryListener.html" title="interface in net.jxta.impl.util">CacheEntryListener</A>&nbsp;listener)</PRE><DL><DD>Creates a cache whih will keep at most maxSize purgeable entries. Every new entry is purgeable by default. Entries that are not purgeable are not counted and are never removed unless clear() or remove() is called. Purgeable entries are removed silently as needed to make room for new entries so that the number of purgeable entries remains < maxSize. Entries prugeability is controlled by invoking the sticky() method or the stickyCacheEntry() method. For now, purged entries are abandonned to the GC which is probably not so bad. To permit acceleration of the collection of resources, a purge listener will be added soon.<P></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="clear()"><!-- --></A><H3>clear</H3><PRE>public void <B>clear</B>()</PRE><DL><DD>Empties the cache completely. The entries are abandonned to the GC.<P><DD><DL></DL></DD></DL><HR><A NAME="purge(int)"><!-- --></A><H3>purge</H3><PRE>public void <B>purge</B>(int&nbsp;fraction)</PRE><DL><DD>Purges some of the cache.  The entries are cleaned-up properly.<P><DD><DL></DL></DD></DL><HR><A NAME="putCacheEntry(java.lang.Object, net.jxta.impl.util.CacheEntry)"><!-- --></A><H3>putCacheEntry</H3><PRE>protected <A HREF="../../../../net/jxta/impl/util/CacheEntry.html" title="interface in net.jxta.impl.util">CacheEntry</A> <B>putCacheEntry</B>(java.lang.Object&nbsp;key,                                   <A HREF="../../../../net/jxta/impl/util/CacheEntry.html" title="interface in net.jxta.impl.util">CacheEntry</A>&nbsp;value)</PRE><DL><DD>Inserts the given cache entry directly. Returns the previous cache entry associated with the given key, if any. Not exposed yet. Should not be a problem to expose it, but it is not needed yet.<P><DD><DL></DL></DD></DL><HR><A NAME="put(java.lang.Object, java.lang.Object)"><!-- --></A><H3>put</H3><PRE>public java.lang.Object <B>put</B>(java.lang.Object&nbsp;key,                            java.lang.Object&nbsp;value)</PRE><DL><DD>Create a cache entry to hold the given value, and insert it. Returns the previous value associated with the given key, if any.<P><DD><DL></DL></DD></DL><HR><A NAME="removeCacheEntry(java.lang.Object)"><!-- --></A><H3>removeCacheEntry</H3><PRE>protected <A HREF="../../../../net/jxta/impl/util/CacheEntry.html" title="interface in net.jxta.impl.util">CacheEntry</A> <B>removeCacheEntry</B>(java.lang.Object&nbsp;key)</PRE><DL><DD>Remove the value, if any, and cacheEntry associated with the given key. return the cacheEntry that has been removed. Not exposed yet. Should not be a problem to expose it, but it is not needed yet.<P><DD><DL></DL></DD></DL><HR><A NAME="remove(java.lang.Object)"><!-- --></A><H3>remove</H3><PRE>public java.lang.Object <B>remove</B>(java.lang.Object&nbsp;key)</PRE><DL><DD>Remove the value, if any, and cacheEntry associated with the given key. returns the value that has been removed.<P><DD><DL></DL></DD></DL><HR><A NAME="getCacheEntry(java.lang.Object)"><!-- --></A><H3>getCacheEntry</H3><PRE>public <A HREF="../../../../net/jxta/impl/util/CacheEntry.html" title="interface in net.jxta.impl.util">CacheEntry</A> <B>getCacheEntry</B>(java.lang.Object&nbsp;key)</PRE><DL><DD>Return the cache entry, if any, associated with the given key. This is public; it improves performance by letting the application do a single lookup instead of two when it needs to find an object in the cache and then change its purgeability.<P><DD><DL></DL></DD></DL><HR><A NAME="get(java.lang.Object)"><!-- --></A><H3>get</H3><PRE>public java.lang.Object <B>get</B>(java.lang.Object&nbsp;key)</PRE><DL><DD>Return the value, if any associated with the given key.<P><DD><DL></DL></DD></DL><HR><A NAME="stickyCacheEntry(net.jxta.impl.util.CacheEntry, boolean)"><!-- --></A><H3>stickyCacheEntry</H3><PRE>public void <B>stickyCacheEntry</B>(<A HREF="../../../../net/jxta/impl/util/CacheEntry.html" title="interface in net.jxta.impl.util">CacheEntry</A>&nbsp;ce,                             boolean&nbsp;sticky)</PRE><DL><DD>Change the purgeability of the given cacheEntry. If sticky is true, the entry cannot be purged. Note: if the CacheEntry is known, it is more efficient to use this method than sticky(), since sticky will preform a hashmap lookup to locate the cache entry.<P><DD><DL></DL></DD></DL><HR><A NAME="sticky(java.lang.Object, boolean)"><!-- --></A><H3>sticky</H3><PRE>public void <B>sticky</B>(java.lang.Object&nbsp;key,                   boolean&nbsp;sticky)</PRE><DL><DD>Force the value associated with the given key to be purgeable or non-purgeable from the cache (non-sticky vs. sticky). Note: Most often, a call to the get() method will be performed before it can be decided to invoke sticky(). Whenever this is the case it is better to invoke getCacheEntry() + getValue() and then stickyCacheEntry() since that eliminates one hashmap lookup.<P><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Cache.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>JXTA J2SE</EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../net/jxta/impl/util/Base64.html" title="class in net.jxta.impl.util"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../../net/jxta/impl/util/Cache.CacheEntryImpl.html" title="class in net.jxta.impl.util"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Cache.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -