| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (version 1.7.0_25) on Wed May 25 23:25:56 EDT 2016 --> |
| <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> |
| <title>SoftHashMap (Apache Shiro 1.2.5 API)</title> |
| <meta name="date" content="2016-05-25"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="SoftHashMap (Apache Shiro 1.2.5 API)"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar_top"> |
| <!-- --> |
| </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/SoftHashMap.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../org/apache/shiro/util/SimpleByteSource.html" title="class in org.apache.shiro.util"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/shiro/util/StringUtils.html" title="class in org.apache.shiro.util"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/shiro/util/SoftHashMap.html" target="_top">Frames</a></li> |
| <li><a href="SoftHashMap.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor_summary">Constr</a> | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor_detail">Constr</a> | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.shiro.util</div> |
| <h2 title="Class SoftHashMap" class="title">Class SoftHashMap<K,V></h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><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></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.shiro.util.SoftHashMap<K,V></li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><K,V></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public class <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.47">SoftHashMap</a><K,V> |
| extends <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> |
| implements <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><K,V></pre> |
| <div class="block">A <code><em>Soft</em>HashMap</code> is a memory-constrained map that stores its <em>values</em> in |
| <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"><code>SoftReference</code></a>s. (Contrast this with the JDK's |
| <a href="http://java.sun.com/javase/6/docs/api/java/util/WeakHashMap.html?is-external=true" title="class or interface in java.util"><code>WeakHashMap</code></a>, which uses weak references for its <em>keys</em>, which is of little value if you |
| want the cache to auto-resize itself based on memory constraints). |
| <p/> |
| Having the values wrapped by soft references allows the cache to automatically reduce its size based on memory |
| limitations and garbage collection. This ensures that the cache will not cause memory leaks by holding strong |
| references to all of its values. |
| <p/> |
| This class is a generics-enabled Map based on initial ideas from Heinz Kabutz's and Sydney Redelinghuys's |
| <a href="http://www.javaspecialists.eu/archive/Issue015.html">publicly posted version (with their approval)</a>, with |
| continued modifications. |
| <p/> |
| This implementation is thread-safe and usable in concurrent environments.</div> |
| <dl><dt><span class="strong">Since:</span></dt> |
| <dd>1.0</dd></dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested_class_summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested_classes_inherited_from_class_java.util.Map"> |
| <!-- --> |
| </a> |
| <h3>Nested classes/interfaces inherited from interface java.util.<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a></h3> |
| <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">Map.Entry</a><<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">K</a>,<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">V</a>></code></li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#SoftHashMap()">SoftHashMap</a></strong>()</code> |
| <div class="block">Creates a new SoftHashMap with a default retention size size of |
| <a href="../../../../org/apache/shiro/util/SoftHashMap.html#DEFAULT_RETENTION_SIZE"><code>DEFAULT_RETENTION_SIZE</code></a> (100 entries).</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#SoftHashMap(int)">SoftHashMap</a></strong>(int retentionSize)</code> |
| <div class="block">Creates a new SoftHashMap with the specified retention size.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#SoftHashMap(java.util.Map)">SoftHashMap</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>> source)</code> |
| <div class="block">Creates a <code>SoftHashMap</code> backed by the specified <code>source</code>, with a default retention |
| size of <a href="../../../../org/apache/shiro/util/SoftHashMap.html#DEFAULT_RETENTION_SIZE"><code>DEFAULT_RETENTION_SIZE</code></a> (100 entries).</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#SoftHashMap(java.util.Map, int)">SoftHashMap</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>> source, |
| int retentionSize)</code> |
| <div class="block">Creates a <code>SoftHashMap</code> backed by the specified <code>source</code>, with the specified retention size.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span>Methods</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#clear()">clear</a></strong>()</code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#containsKey(java.lang.Object)">containsKey</a></strong>(<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> key)</code> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#containsValue(java.lang.Object)">containsValue</a></strong>(<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> value)</code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">Map.Entry</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>>></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#entrySet()">entrySet</a></strong>()</code> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#get(java.lang.Object)">get</a></strong>(<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> key)</code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#isEmpty()">isEmpty</a></strong>()</code> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#keySet()">keySet</a></strong>()</code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#put(K, V)">put</a></strong>(<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a> key, |
| <a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a> value)</code> |
| <div class="block">Creates a new entry, but wraps the value in a SoftValue instance to enable auto garbage collection.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#putAll(java.util.Map)">putAll</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><? extends <a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,? extends <a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>> m)</code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#remove(java.lang.Object)">remove</a></strong>(<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> key)</code> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>int</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#size()">size</a></strong>()</code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/util/SoftHashMap.html#values()">values</a></strong>()</code> </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>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></h3> |
| <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></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods_inherited_from_class_java.util.Map"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface java.util.<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a></h3> |
| <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.util">equals</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#hashCode()" title="class or interface in java.util">hashCode</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="SoftHashMap()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>SoftHashMap</h4> |
| <pre>public <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.82">SoftHashMap</a>()</pre> |
| <div class="block">Creates a new SoftHashMap with a default retention size size of |
| <a href="../../../../org/apache/shiro/util/SoftHashMap.html#DEFAULT_RETENTION_SIZE"><code>DEFAULT_RETENTION_SIZE</code></a> (100 entries).</div> |
| <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/shiro/util/SoftHashMap.html#SoftHashMap(int)"><code>SoftHashMap(int)</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="SoftHashMap(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>SoftHashMap</h4> |
| <pre>public <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.102">SoftHashMap</a>(int retentionSize)</pre> |
| <div class="block">Creates a new SoftHashMap with the specified retention size. |
| <p/> |
| The retention size (n) is the total number of most recent entries in the map that will be strongly referenced |
| (ie 'retained') to prevent them from being eagerly garbage collected. That is, the point of a SoftHashMap is to |
| allow the garbage collector to remove as many entries from this map as it desires, but there will always be (n) |
| elements retained after a GC due to the strong references. |
| <p/> |
| Note that in a highly concurrent environments the exact total number of strong references may differ slightly |
| than the actual <code>retentionSize</code> value. This number is intended to be a best-effort retention low |
| water mark.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>retentionSize</code> - the total number of most recent entries in the map that will be strongly referenced |
| (retained), preventing them from being eagerly garbage collected by the JVM.</dd></dl> |
| </li> |
| </ul> |
| <a name="SoftHashMap(java.util.Map)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>SoftHashMap</h4> |
| <pre>public <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.118">SoftHashMap</a>(<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>> source)</pre> |
| <div class="block">Creates a <code>SoftHashMap</code> backed by the specified <code>source</code>, with a default retention |
| size of <a href="../../../../org/apache/shiro/util/SoftHashMap.html#DEFAULT_RETENTION_SIZE"><code>DEFAULT_RETENTION_SIZE</code></a> (100 entries).</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>source</code> - the backing map to populate this <code>SoftHashMap</code></dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/shiro/util/SoftHashMap.html#SoftHashMap(java.util.Map, int)"><code>SoftHashMap(Map,int)</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="SoftHashMap(java.util.Map, int)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>SoftHashMap</h4> |
| <pre>public <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.139">SoftHashMap</a>(<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>> source, |
| int retentionSize)</pre> |
| <div class="block">Creates a <code>SoftHashMap</code> backed by the specified <code>source</code>, with the specified retention size. |
| <p/> |
| The retention size (n) is the total number of most recent entries in the map that will be strongly referenced |
| (ie 'retained') to prevent them from being eagerly garbage collected. That is, the point of a SoftHashMap is to |
| allow the garbage collector to remove as many entries from this map as it desires, but there will always be (n) |
| elements retained after a GC due to the strong references. |
| <p/> |
| Note that in a highly concurrent environments the exact total number of strong references may differ slightly |
| than the actual <code>retentionSize</code> value. This number is intended to be a best-effort retention low |
| water mark.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>source</code> - the backing map to populate this <code>SoftHashMap</code></dd><dd><code>retentionSize</code> - the total number of most recent entries in the map that will be strongly referenced |
| (retained), preventing them from being eagerly garbage collected by the JVM.</dd></dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="get(java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>get</h4> |
| <pre>public <a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a> <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.144">get</a>(<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> key)</pre> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#get(java.lang.Object)" title="class or interface in java.util">get</a></code> in interface <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isEmpty()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isEmpty</h4> |
| <pre>public boolean <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.197">isEmpty</a>()</pre> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#isEmpty()" title="class or interface in java.util">isEmpty</a></code> in interface <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="containsKey(java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>containsKey</h4> |
| <pre>public boolean <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.202">containsKey</a>(<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> key)</pre> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#containsKey(java.lang.Object)" title="class or interface in java.util">containsKey</a></code> in interface <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="containsValue(java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>containsValue</h4> |
| <pre>public boolean <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.207">containsValue</a>(<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> value)</pre> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#containsValue(java.lang.Object)" title="class or interface in java.util">containsValue</a></code> in interface <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="putAll(java.util.Map)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>putAll</h4> |
| <pre>public void <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.213">putAll</a>(<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><? extends <a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,? extends <a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>> m)</pre> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#putAll(java.util.Map)" title="class or interface in java.util">putAll</a></code> in interface <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="keySet()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>keySet</h4> |
| <pre>public <a href="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>> <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.223">keySet</a>()</pre> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#keySet()" title="class or interface in java.util">keySet</a></code> in interface <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="values()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>values</h4> |
| <pre>public <a href="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>> <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.228">values</a>()</pre> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#values()" title="class or interface in java.util">values</a></code> in interface <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="put(java.lang.Object,java.lang.Object)"> |
| <!-- --> |
| </a><a name="put(K, V)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>put</h4> |
| <pre>public <a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a> <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.248">put</a>(<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a> key, |
| <a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a> value)</pre> |
| <div class="block">Creates a new entry, but wraps the value in a SoftValue instance to enable auto garbage collection.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#put(K, V)" title="class or interface in java.util">put</a></code> in interface <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="remove(java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>remove</h4> |
| <pre>public <a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a> <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.256">remove</a>(<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> key)</pre> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#remove(java.lang.Object)" title="class or interface in java.util">remove</a></code> in interface <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="clear()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>clear</h4> |
| <pre>public void <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.262">clear</a>()</pre> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#clear()" title="class or interface in java.util">clear</a></code> in interface <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="size()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>size</h4> |
| <pre>public int <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.273">size</a>()</pre> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#size()" title="class or interface in java.util">size</a></code> in interface <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="entrySet()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>entrySet</h4> |
| <pre>public <a href="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">Map.Entry</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>>> <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.278">entrySet</a>()</pre> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#entrySet()" title="class or interface in java.util">entrySet</a></code> in interface <code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>,<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar_bottom"> |
| <!-- --> |
| </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/SoftHashMap.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../org/apache/shiro/util/SimpleByteSource.html" title="class in org.apache.shiro.util"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/shiro/util/StringUtils.html" title="class in org.apache.shiro.util"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/shiro/util/SoftHashMap.html" target="_top">Frames</a></li> |
| <li><a href="SoftHashMap.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor_summary">Constr</a> | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor_detail">Constr</a> | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2004-2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p> |
| </body> |
| </html> |