blob: 7a31ea3c7177aba1b2433452ea1ca58b561dc2b8 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="fr">
<head>
<!-- Generated by javadoc (1.8.0_201) on Wed May 01 07:16:43 RET 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SoftHashMap (Apache Shiro 1.4.1 API)</title>
<meta name="date" content="2019-05-01">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SoftHashMap (Apache Shiro 1.4.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/shiro/util/StringUtils.html" title="class in org.apache.shiro.util"><span class="typeNameLink">Next&nbsp;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&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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&lt;K,V&gt;</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.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&lt;K,V&gt;</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;K,V&gt;</dd>
</dl>
<hr>
<br>
<pre>public class <a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.47">SoftHashMap</a>&lt;K,V&gt;
extends <a href="http://docs.oracle.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://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;K,V&gt;</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://docs.oracle.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://docs.oracle.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="simpleTagLabel">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&nbsp;java.util.<a href="http://docs.oracle.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://docs.oracle.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">Map.Entry</a>&lt;<a href="http://docs.oracle.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://docs.oracle.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">V</a>&gt;</code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#SoftHashMap--">SoftHashMap</a></span>()</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><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#SoftHashMap-int-">SoftHashMap</a></span>(int&nbsp;retentionSize)</code>
<div class="block">Creates a new SoftHashMap with the specified retention size.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#SoftHashMap-java.util.Map-">SoftHashMap</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;&nbsp;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><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#SoftHashMap-java.util.Map-int-">SoftHashMap</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;&nbsp;source,
int&nbsp;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="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#clear--">clear</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#containsKey-java.lang.Object-">containsKey</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;key)</code>&nbsp;</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#containsValue-java.lang.Object-">containsValue</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">Map.Entry</a>&lt;<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>&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#entrySet--">entrySet</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i4" 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><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#get-java.lang.Object-">get</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;key)</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#isEmpty--">isEmpty</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#keySet--">keySet</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i7" 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><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#put-K-V-">put</a></span>(<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>&nbsp;key,
<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>&nbsp;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 id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#putAll-java.util.Map-">putAll</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;? 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>&gt;&nbsp;m)</code>&nbsp;</td>
</tr>
<tr id="i9" 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><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#remove-java.lang.Object-">remove</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;key)</code>&nbsp;</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#size--">size</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/util/SoftHashMap.html#values--">values</a></span>()</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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&nbsp;java.util.<a href="http://docs.oracle.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://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#compute-K-java.util.function.BiFunction-" title="class or interface in java.util">compute</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#computeIfAbsent-K-java.util.function.Function-" title="class or interface in java.util">computeIfAbsent</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#computeIfPresent-K-java.util.function.BiFunction-" title="class or interface in java.util">computeIfPresent</a>, <a href="http://docs.oracle.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://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#forEach-java.util.function.BiConsumer-" title="class or interface in java.util">forEach</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#getOrDefault-java.lang.Object-V-" title="class or interface in java.util">getOrDefault</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#hashCode--" title="class or interface in java.util">hashCode</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#merge-K-V-java.util.function.BiFunction-" title="class or interface in java.util">merge</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#putIfAbsent-K-V-" title="class or interface in java.util">putIfAbsent</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#remove-java.lang.Object-java.lang.Object-" title="class or interface in java.util">remove</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#replace-K-V-" title="class or interface in java.util">replace</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#replace-K-V-V-" title="class or interface in java.util">replace</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#replaceAll-java.util.function.BiFunction-" title="class or interface in java.util">replaceAll</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&nbsp;<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="seeLabel">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&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.102">SoftHashMap</a>(int&nbsp;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="paramLabel">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&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.118">SoftHashMap</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;&nbsp;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="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - the backing map to populate this <code>SoftHashMap</code></dd>
<dt><span class="seeLabel">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&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.139">SoftHashMap</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;&nbsp;source,
int&nbsp;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="paramLabel">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&nbsp;<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.144">get</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;key)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.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>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="isEmpty--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEmpty</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.197">isEmpty</a>()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#isEmpty--" title="class or interface in java.util">isEmpty</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="containsKey-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>containsKey</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.202">containsKey</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;key)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.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>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="containsValue-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>containsValue</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.207">containsValue</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.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>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="putAll-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putAll</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.213">putAll</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;? 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>&gt;&nbsp;m)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.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>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="keySet--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>keySet</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">K</a>&gt;&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.223">keySet</a>()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#keySet--" title="class or interface in java.util">keySet</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="values--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>values</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>&gt;&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.228">values</a>()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#values--" title="class or interface in java.util">values</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;</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&nbsp;<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>&nbsp;<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>&nbsp;key,
<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>&nbsp;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><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.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>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="remove-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>remove</h4>
<pre>public&nbsp;<a href="../../../../org/apache/shiro/util/SoftHashMap.html" title="type parameter in SoftHashMap">V</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.256">remove</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;key)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.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>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="clear--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clear</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.262">clear</a>()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#clear--" title="class or interface in java.util">clear</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="size--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>size</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.273">size</a>()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#size--" title="class or interface in java.util">size</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="entrySet--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>entrySet</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">Map.Entry</a>&lt;<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>&gt;&gt;&nbsp;<a href="../../../../src-html/org/apache/shiro/util/SoftHashMap.html#line.278">entrySet</a>()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true#entrySet--" title="class or interface in java.util">entrySet</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>&gt;</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>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/shiro/util/StringUtils.html" title="class in org.apache.shiro.util"><span class="typeNameLink">Next&nbsp;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&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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 &#169; 2004&#x2013;2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>