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