1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!-- NewPage -->
3<html lang="en">
4<head>
5<!-- Generated by javadoc (version 1.7.0_79) on Wed Jul 20 08:39:14 PDT 2016 -->
6<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7<title>LRUMap (jackson-databind 2.8.0 API)</title>
8<meta name="date" content="2016-07-20">
9<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
10</head>
11<body>
12<script type="text/javascript"><!--
13    if (location.href.indexOf('is-external=true') == -1) {
14        parent.document.title="LRUMap (jackson-databind 2.8.0 API)";
15    }
16//-->
17</script>
18<noscript>
19<div>JavaScript is disabled on your browser.</div>
20</noscript>
21<!-- ========= START OF TOP NAVBAR ======= -->
22<div class="topNav"><a name="navbar_top">
23<!--   -->
24</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
25<!--   -->
26</a>
27<ul class="navList" title="Navigation">
28<li><a href="../../../../../overview-summary.html">Overview</a></li>
29<li><a href="package-summary.html">Package</a></li>
30<li class="navBarCell1Rev">Class</li>
31<li><a href="class-use/LRUMap.html">Use</a></li>
32<li><a href="package-tree.html">Tree</a></li>
33<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
34<li><a href="../../../../../index-all.html">Index</a></li>
35<li><a href="../../../../../help-doc.html">Help</a></li>
36</ul>
37</div>
38<div class="subNav">
39<ul class="navList">
40<li><a href="../../../../../com/fasterxml/jackson/databind/util/LinkedNode.html" title="class in com.fasterxml.jackson.databind.util"><span class="strong">Prev Class</span></a></li>
41<li><a href="../../../../../com/fasterxml/jackson/databind/util/Named.html" title="interface in com.fasterxml.jackson.databind.util"><span class="strong">Next Class</span></a></li>
42</ul>
43<ul class="navList">
44<li><a href="../../../../../index.html?com/fasterxml/jackson/databind/util/LRUMap.html" target="_top">Frames</a></li>
45<li><a href="LRUMap.html" target="_top">No Frames</a></li>
46</ul>
47<ul class="navList" id="allclasses_navbar_top">
48<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
49</ul>
50<div>
51<script type="text/javascript"><!--
52  allClassesLink = document.getElementById("allclasses_navbar_top");
53  if(window==top) {
54    allClassesLink.style.display = "block";
55  }
56  else {
57    allClassesLink.style.display = "none";
58  }
59  //-->
60</script>
61</div>
62<div>
63<ul class="subNavList">
64<li>Summary:&nbsp;</li>
65<li>Nested&nbsp;|&nbsp;</li>
66<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
67<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
68<li><a href="#method_summary">Method</a></li>
69</ul>
70<ul class="subNavList">
71<li>Detail:&nbsp;</li>
72<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
73<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
74<li><a href="#method_detail">Method</a></li>
75</ul>
76</div>
77<a name="skip-navbar_top">
78<!--   -->
79</a></div>
80<!-- ========= END OF TOP NAVBAR ========= -->
81<!-- ======== START OF CLASS DATA ======== -->
82<div class="header">
83<div class="subTitle">com.fasterxml.jackson.databind.util</div>
84<h2 title="Class LRUMap" class="title">Class LRUMap&lt;K,V&gt;</h2>
85</div>
86<div class="contentContainer">
87<ul class="inheritance">
88<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
89<li>
90<ul class="inheritance">
91<li>com.fasterxml.jackson.databind.util.LRUMap&lt;K,V&gt;</li>
92</ul>
93</li>
94</ul>
95<div class="description">
96<ul class="blockList">
97<li class="blockList">
98<dl>
99<dt>All Implemented Interfaces:</dt>
100<dd><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd>
101</dl>
102<hr>
103<br>
104<pre>public class <span class="strong">LRUMap&lt;K,V&gt;</span>
105extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
106implements <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
107<div class="block">Helper for simple bounded maps used for reusing lookup values.
108<p>
109 Note that serialization behavior is such that contents are NOT serialized,
110 on assumption that all use cases are for caching where persistence
111 does not make sense. The only thing serialized is the cache size of Map.
112<p>
113 NOTE: since version 2.4.2, this is <b>NOT</b> an LRU-based at all; reason
114 being that it is not possible to use JDK components that do LRU _AND_ perform
115 well wrt synchronization on multi-core systems. So we choose efficient synchronization
116 over potentially more efficient handling of entries.
117<p>
118 And yes, there are efficient LRU implementations such as
119 <a href="https://code.google.com/p/concurrentlinkedhashmap/">concurrentlinkedhashmap</a>;
120 but at this point we really try to keep external deps to minimum. But perhaps
121 a shaded variant may be used one day.</div>
122<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../serialized-form.html#com.fasterxml.jackson.databind.util.LRUMap">Serialized Form</a></dd></dl>
123</li>
124</ul>
125</div>
126<div class="summary">
127<ul class="blockList">
128<li class="blockList">
129<!-- =========== FIELD SUMMARY =========== -->
130<ul class="blockList">
131<li class="blockList"><a name="field_summary">
132<!--   -->
133</a>
134<h3>Field Summary</h3>
135<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
136<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
137<tr>
138<th class="colFirst" scope="col">Modifier and Type</th>
139<th class="colLast" scope="col">Field and Description</th>
140</tr>
141<tr class="altColor">
142<td class="colFirst"><code>protected int</code></td>
143<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html#_jdkSerializeMaxEntries">_jdkSerializeMaxEntries</a></strong></code>
144<div class="block">Ugly hack, to work through the requirement that _value is indeed final,
145 and that JDK serialization won't call ctor(s) if Serializable is implemented.</div>
146</td>
147</tr>
148<tr class="rowColor">
149<td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentHashMap.html?is-external=true" title="class or interface in java.util.concurrent">ConcurrentHashMap</a>&lt;<a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">K</a>,<a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">V</a>&gt;</code></td>
150<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html#_map">_map</a></strong></code>&nbsp;</td>
151</tr>
152<tr class="altColor">
153<td class="colFirst"><code>protected int</code></td>
154<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html#_maxEntries">_maxEntries</a></strong></code>&nbsp;</td>
155</tr>
156</table>
157</li>
158</ul>
159<!-- ======== CONSTRUCTOR SUMMARY ======== -->
160<ul class="blockList">
161<li class="blockList"><a name="constructor_summary">
162<!--   -->
163</a>
164<h3>Constructor Summary</h3>
165<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
166<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
167<tr>
168<th class="colOne" scope="col">Constructor and Description</th>
169</tr>
170<tr class="altColor">
171<td class="colOne"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html#LRUMap(int,%20int)">LRUMap</a></strong>(int&nbsp;initialEntries,
172      int&nbsp;maxEntries)</code>&nbsp;</td>
173</tr>
174</table>
175</li>
176</ul>
177<!-- ========== METHOD SUMMARY =========== -->
178<ul class="blockList">
179<li class="blockList"><a name="method_summary">
180<!--   -->
181</a>
182<h3>Method Summary</h3>
183<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
184<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
185<tr>
186<th class="colFirst" scope="col">Modifier and Type</th>
187<th class="colLast" scope="col">Method and Description</th>
188</tr>
189<tr class="altColor">
190<td class="colFirst"><code>void</code></td>
191<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html#clear()">clear</a></strong>()</code>&nbsp;</td>
192</tr>
193<tr class="rowColor">
194<td class="colFirst"><code><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">V</a></code></td>
195<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html#get(java.lang.Object)">get</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;key)</code>&nbsp;</td>
196</tr>
197<tr class="altColor">
198<td class="colFirst"><code><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">V</a></code></td>
199<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html#put(K,%20V)">put</a></strong>(<a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">K</a>&nbsp;key,
200   <a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">V</a>&nbsp;value)</code>&nbsp;</td>
201</tr>
202<tr class="rowColor">
203<td class="colFirst"><code><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">V</a></code></td>
204<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html#putIfAbsent(K,%20V)">putIfAbsent</a></strong>(<a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">K</a>&nbsp;key,
205           <a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">V</a>&nbsp;value)</code>&nbsp;</td>
206</tr>
207<tr class="altColor">
208<td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
209<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html#readResolve()">readResolve</a></strong>()</code>&nbsp;</td>
210</tr>
211<tr class="rowColor">
212<td class="colFirst"><code>int</code></td>
213<td class="colLast"><code><strong><a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html#size()">size</a></strong>()</code>&nbsp;</td>
214</tr>
215</table>
216<ul class="blockList">
217<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
218<!--   -->
219</a>
220<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
221<code><a href="http://docs.oracle.com/javase/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
222</ul>
223</li>
224</ul>
225</li>
226</ul>
227</div>
228<div class="details">
229<ul class="blockList">
230<li class="blockList">
231<!-- ============ FIELD DETAIL =========== -->
232<ul class="blockList">
233<li class="blockList"><a name="field_detail">
234<!--   -->
235</a>
236<h3>Field Detail</h3>
237<a name="_maxEntries">
238<!--   -->
239</a>
240<ul class="blockList">
241<li class="blockList">
242<h4>_maxEntries</h4>
243<pre>protected final transient&nbsp;int _maxEntries</pre>
244</li>
245</ul>
246<a name="_map">
247<!--   -->
248</a>
249<ul class="blockList">
250<li class="blockList">
251<h4>_map</h4>
252<pre>protected final transient&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentHashMap.html?is-external=true" title="class or interface in java.util.concurrent">ConcurrentHashMap</a>&lt;<a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">K</a>,<a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">V</a>&gt; _map</pre>
253</li>
254</ul>
255<a name="_jdkSerializeMaxEntries">
256<!--   -->
257</a>
258<ul class="blockListLast">
259<li class="blockList">
260<h4>_jdkSerializeMaxEntries</h4>
261<pre>protected transient&nbsp;int _jdkSerializeMaxEntries</pre>
262<div class="block">Ugly hack, to work through the requirement that _value is indeed final,
263 and that JDK serialization won't call ctor(s) if Serializable is implemented.</div>
264<dl><dt><span class="strong">Since:</span></dt>
265  <dd>2.1</dd></dl>
266</li>
267</ul>
268</li>
269</ul>
270<!-- ========= CONSTRUCTOR DETAIL ======== -->
271<ul class="blockList">
272<li class="blockList"><a name="constructor_detail">
273<!--   -->
274</a>
275<h3>Constructor Detail</h3>
276<a name="LRUMap(int, int)">
277<!--   -->
278</a>
279<ul class="blockListLast">
280<li class="blockList">
281<h4>LRUMap</h4>
282<pre>public&nbsp;LRUMap(int&nbsp;initialEntries,
283      int&nbsp;maxEntries)</pre>
284</li>
285</ul>
286</li>
287</ul>
288<!-- ============ METHOD DETAIL ========== -->
289<ul class="blockList">
290<li class="blockList"><a name="method_detail">
291<!--   -->
292</a>
293<h3>Method Detail</h3>
294<a name="put(java.lang.Object,java.lang.Object)">
295<!--   -->
296</a><a name="put(K, V)">
297<!--   -->
298</a>
299<ul class="blockList">
300<li class="blockList">
301<h4>put</h4>
302<pre>public&nbsp;<a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">V</a>&nbsp;put(<a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">K</a>&nbsp;key,
303    <a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">V</a>&nbsp;value)</pre>
304</li>
305</ul>
306<a name="putIfAbsent(java.lang.Object,java.lang.Object)">
307<!--   -->
308</a><a name="putIfAbsent(K, V)">
309<!--   -->
310</a>
311<ul class="blockList">
312<li class="blockList">
313<h4>putIfAbsent</h4>
314<pre>public&nbsp;<a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">V</a>&nbsp;putIfAbsent(<a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">K</a>&nbsp;key,
315            <a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">V</a>&nbsp;value)</pre>
316<dl><dt><span class="strong">Since:</span></dt>
317  <dd>2.5</dd></dl>
318</li>
319</ul>
320<a name="get(java.lang.Object)">
321<!--   -->
322</a>
323<ul class="blockList">
324<li class="blockList">
325<h4>get</h4>
326<pre>public&nbsp;<a href="../../../../../com/fasterxml/jackson/databind/util/LRUMap.html" title="type parameter in LRUMap">V</a>&nbsp;get(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;key)</pre>
327</li>
328</ul>
329<a name="clear()">
330<!--   -->
331</a>
332<ul class="blockList">
333<li class="blockList">
334<h4>clear</h4>
335<pre>public&nbsp;void&nbsp;clear()</pre>
336</li>
337</ul>
338<a name="size()">
339<!--   -->
340</a>
341<ul class="blockList">
342<li class="blockList">
343<h4>size</h4>
344<pre>public&nbsp;int&nbsp;size()</pre>
345</li>
346</ul>
347<a name="readResolve()">
348<!--   -->
349</a>
350<ul class="blockListLast">
351<li class="blockList">
352<h4>readResolve</h4>
353<pre>protected&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;readResolve()</pre>
354</li>
355</ul>
356</li>
357</ul>
358</li>
359</ul>
360</div>
361</div>
362<!-- ========= END OF CLASS DATA ========= -->
363<!-- ======= START OF BOTTOM NAVBAR ====== -->
364<div class="bottomNav"><a name="navbar_bottom">
365<!--   -->
366</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
367<!--   -->
368</a>
369<ul class="navList" title="Navigation">
370<li><a href="../../../../../overview-summary.html">Overview</a></li>
371<li><a href="package-summary.html">Package</a></li>
372<li class="navBarCell1Rev">Class</li>
373<li><a href="class-use/LRUMap.html">Use</a></li>
374<li><a href="package-tree.html">Tree</a></li>
375<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
376<li><a href="../../../../../index-all.html">Index</a></li>
377<li><a href="../../../../../help-doc.html">Help</a></li>
378</ul>
379</div>
380<div class="subNav">
381<ul class="navList">
382<li><a href="../../../../../com/fasterxml/jackson/databind/util/LinkedNode.html" title="class in com.fasterxml.jackson.databind.util"><span class="strong">Prev Class</span></a></li>
383<li><a href="../../../../../com/fasterxml/jackson/databind/util/Named.html" title="interface in com.fasterxml.jackson.databind.util"><span class="strong">Next Class</span></a></li>
384</ul>
385<ul class="navList">
386<li><a href="../../../../../index.html?com/fasterxml/jackson/databind/util/LRUMap.html" target="_top">Frames</a></li>
387<li><a href="LRUMap.html" target="_top">No Frames</a></li>
388</ul>
389<ul class="navList" id="allclasses_navbar_bottom">
390<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
391</ul>
392<div>
393<script type="text/javascript"><!--
394  allClassesLink = document.getElementById("allclasses_navbar_bottom");
395  if(window==top) {
396    allClassesLink.style.display = "block";
397  }
398  else {
399    allClassesLink.style.display = "none";
400  }
401  //-->
402</script>
403</div>
404<div>
405<ul class="subNavList">
406<li>Summary:&nbsp;</li>
407<li>Nested&nbsp;|&nbsp;</li>
408<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
409<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
410<li><a href="#method_summary">Method</a></li>
411</ul>
412<ul class="subNavList">
413<li>Detail:&nbsp;</li>
414<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
415<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
416<li><a href="#method_detail">Method</a></li>
417</ul>
418</div>
419<a name="skip-navbar_bottom">
420<!--   -->
421</a></div>
422<!-- ======== END OF BOTTOM NAVBAR ======= -->
423<p class="legalCopy"><small>Copyright &#169; 2008&#x2013;2016 <a href="http://fasterxml.com/">FasterXML</a>. All rights reserved.</small></p>
424</body>
425</html>
426