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_10-ea) on Sun Jul 14 20:03:24 PDT 2013 --> 6<title>BytesToNameCanonicalizer (Jackson JSON Processor)</title> 7<meta name="date" content="2013-07-14"> 8<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> 9</head> 10<body> 11<script type="text/javascript"><!-- 12 if (location.href.indexOf('is-external=true') == -1) { 13 parent.document.title="BytesToNameCanonicalizer (Jackson JSON Processor)"; 14 } 15//--> 16</script> 17<noscript> 18<div>JavaScript is disabled on your browser.</div> 19</noscript> 20<!-- ========= START OF TOP NAVBAR ======= --> 21<div class="topNav"><a name="navbar_top"> 22<!-- --> 23</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> 24<!-- --> 25</a> 26<ul class="navList" title="Navigation"> 27<li><a href="../../../../overview-summary.html">Overview</a></li> 28<li><a href="package-summary.html">Package</a></li> 29<li class="navBarCell1Rev">Class</li> 30<li><a href="class-use/BytesToNameCanonicalizer.html">Use</a></li> 31<li><a href="package-tree.html">Tree</a></li> 32<li><a href="../../../../deprecated-list.html">Deprecated</a></li> 33<li><a href="../../../../index-all.html">Index</a></li> 34<li><a href="../../../../help-doc.html">Help</a></li> 35</ul> 36</div> 37<div class="subNav"> 38<ul class="navList"> 39<li>Prev Class</li> 40<li><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym"><span class="strong">Next Class</span></a></li> 41</ul> 42<ul class="navList"> 43<li><a href="../../../../index.html?org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" target="_top">Frames</a></li> 44<li><a href="BytesToNameCanonicalizer.html" target="_top">No Frames</a></li> 45</ul> 46<ul class="navList" id="allclasses_navbar_top"> 47<li><a href="../../../../allclasses-noframe.html">All Classes</a></li> 48</ul> 49<div> 50<script type="text/javascript"><!-- 51 allClassesLink = document.getElementById("allclasses_navbar_top"); 52 if(window==top) { 53 allClassesLink.style.display = "block"; 54 } 55 else { 56 allClassesLink.style.display = "none"; 57 } 58 //--> 59</script> 60</div> 61<div> 62<ul class="subNavList"> 63<li>Summary: </li> 64<li>Nested | </li> 65<li><a href="#field_summary">Field</a> | </li> 66<li>Constr | </li> 67<li><a href="#method_summary">Method</a></li> 68</ul> 69<ul class="subNavList"> 70<li>Detail: </li> 71<li><a href="#field_detail">Field</a> | </li> 72<li>Constr | </li> 73<li><a href="#method_detail">Method</a></li> 74</ul> 75</div> 76<a name="skip-navbar_top"> 77<!-- --> 78</a></div> 79<!-- ========= END OF TOP NAVBAR ========= --> 80<!-- ======== START OF CLASS DATA ======== --> 81<div class="header"> 82<div class="subTitle">org.codehaus.jackson.sym</div> 83<h2 title="Class BytesToNameCanonicalizer" class="title">Class BytesToNameCanonicalizer</h2> 84</div> 85<div class="contentContainer"> 86<ul class="inheritance"> 87<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> 88<li> 89<ul class="inheritance"> 90<li>org.codehaus.jackson.sym.BytesToNameCanonicalizer</li> 91</ul> 92</li> 93</ul> 94<div class="description"> 95<ul class="blockList"> 96<li class="blockList"> 97<hr> 98<br> 99<pre>public final class <span class="strong">BytesToNameCanonicalizer</span> 100extends <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></pre> 101<div class="block">A caching symbol table implementation used for canonicalizing JSON field 102 names (as <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym"><code>Name</code></a>s which are constructed directly from a byte-based 103 input source). 104 Complications arise from trying to do efficient reuse and merging of 105 symbol tables, to be able to make use of usually shared vocabulary 106 of subsequent parsing runs.</div> 107<dl><dt><span class="strong">Author:</span></dt> 108 <dd>Tatu Saloranta</dd></dl> 109</li> 110</ul> 111</div> 112<div class="summary"> 113<ul class="blockList"> 114<li class="blockList"> 115<!-- =========== FIELD SUMMARY =========== --> 116<ul class="blockList"> 117<li class="blockList"><a name="field_summary"> 118<!-- --> 119</a> 120<h3>Field Summary</h3> 121<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> 122<caption><span>Fields</span><span class="tabEnd"> </span></caption> 123<tr> 124<th class="colFirst" scope="col">Modifier and Type</th> 125<th class="colLast" scope="col">Field and Description</th> 126</tr> 127<tr class="altColor"> 128<td class="colFirst"><code>protected int</code></td> 129<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_collCount">_collCount</a></strong></code> 130<div class="block">Total number of Names in collision buckets (included in 131 <code>_count</code> along with primary entries)</div> 132</td> 133</tr> 134<tr class="rowColor"> 135<td class="colFirst"><code>protected int</code></td> 136<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_collEnd">_collEnd</a></strong></code> 137<div class="block">Index of the first unused collision bucket entry (== size of 138 the used portion of collision list): less than 139 or equal to 0xFF (255), since max number of entries is 255 140 (8-bit, minus 0 used as 'empty' marker)</div> 141</td> 142</tr> 143<tr class="altColor"> 144<td class="colFirst"><code>protected org.codehaus.jackson.sym.BytesToNameCanonicalizer.Bucket[]</code></td> 145<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_collList">_collList</a></strong></code> 146<div class="block">Array of heads of collision bucket chains; size dynamically</div> 147</td> 148</tr> 149<tr class="rowColor"> 150<td class="colFirst"><code>protected int</code></td> 151<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_count">_count</a></strong></code> 152<div class="block">Total number of Names in the symbol table; 153 only used for child tables.</div> 154</td> 155</tr> 156<tr class="altColor"> 157<td class="colFirst"><code>protected boolean</code></td> 158<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_intern">_intern</a></strong></code> 159<div class="block">Whether canonical symbol Strings are to be intern()ed before added 160 to the table or not</div> 161</td> 162</tr> 163<tr class="rowColor"> 164<td class="colFirst"><code>protected int</code></td> 165<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_longestCollisionList">_longestCollisionList</a></strong></code> 166<div class="block">We need to keep track of the longest collision list; this is needed 167 both to indicate problems with attacks and to allow flushing for 168 other cases.</div> 169</td> 170</tr> 171<tr class="altColor"> 172<td class="colFirst"><code>protected int[]</code></td> 173<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_mainHash">_mainHash</a></strong></code> 174<div class="block">Array of 2^N size, which contains combination 175 of 24-bits of hash (0 to indicate 'empty' slot), 176 and 8-bit collision bucket index (0 to indicate empty 177 collision bucket chain; otherwise subtract one from index)</div> 178</td> 179</tr> 180<tr class="rowColor"> 181<td class="colFirst"><code>protected int</code></td> 182<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_mainHashMask">_mainHashMask</a></strong></code> 183<div class="block">Mask used to truncate 32-bit hash value to current hash array 184 size; essentially, hash array size - 1 (since hash array sizes 185 are 2^N).</div> 186</td> 187</tr> 188<tr class="altColor"> 189<td class="colFirst"><code>protected <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a>[]</code></td> 190<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_mainNames">_mainNames</a></strong></code> 191<div class="block">Array that contains <code>Name</code> instances matching 192 entries in <code>_mainHash</code>.</div> 193</td> 194</tr> 195<tr class="rowColor"> 196<td class="colFirst"><code>protected <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a></code></td> 197<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_parent">_parent</a></strong></code> 198<div class="block">Reference to the root symbol table, for child tables, so 199 that they can merge table information back as necessary.</div> 200</td> 201</tr> 202<tr class="altColor"> 203<td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/atomic/AtomicReference.html?is-external=true" title="class or interface in java.util.concurrent.atomic">AtomicReference</a><org.codehaus.jackson.sym.BytesToNameCanonicalizer.TableInfo></code></td> 204<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_tableInfo">_tableInfo</a></strong></code> 205<div class="block">Member that is only used by the root table instance: root 206 passes immutable state into child instances, and children 207 may return new state if they add entries to the table.</div> 208</td> 209</tr> 210<tr class="rowColor"> 211<td class="colFirst"><code>protected static int</code></td> 212<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#DEFAULT_TABLE_SIZE">DEFAULT_TABLE_SIZE</a></strong></code> </td> 213</tr> 214<tr class="altColor"> 215<td class="colFirst"><code>protected static int</code></td> 216<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#MAX_TABLE_SIZE">MAX_TABLE_SIZE</a></strong></code> 217<div class="block">Let's not expand symbol tables past some maximum size; 218 this should protected against OOMEs caused by large documents 219 with unique (~= random) names.</div> 220</td> 221</tr> 222</table> 223</li> 224</ul> 225<!-- ========== METHOD SUMMARY =========== --> 226<ul class="blockList"> 227<li class="blockList"><a name="method_summary"> 228<!-- --> 229</a> 230<h3>Method Summary</h3> 231<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> 232<caption><span>Methods</span><span class="tabEnd"> </span></caption> 233<tr> 234<th class="colFirst" scope="col">Modifier and Type</th> 235<th class="colLast" scope="col">Method and Description</th> 236</tr> 237<tr class="altColor"> 238<td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a></code></td> 239<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#addName(java.lang.String, int[], int)">addName</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> symbolStr, 240 int[] quads, 241 int qlen)</code> </td> 242</tr> 243<tr class="rowColor"> 244<td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a></code></td> 245<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#addName(java.lang.String, int, int)">addName</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> symbolStr, 246 int q1, 247 int q2)</code> </td> 248</tr> 249<tr class="altColor"> 250<td class="colFirst"><code>int</code></td> 251<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#bucketCount()">bucketCount</a></strong>()</code> </td> 252</tr> 253<tr class="rowColor"> 254<td class="colFirst"><code>int</code></td> 255<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#calcHash(int)">calcHash</a></strong>(int firstQuad)</code> </td> 256</tr> 257<tr class="altColor"> 258<td class="colFirst"><code>int</code></td> 259<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#calcHash(int[], int)">calcHash</a></strong>(int[] quads, 260 int qlen)</code> </td> 261</tr> 262<tr class="rowColor"> 263<td class="colFirst"><code>int</code></td> 264<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#calcHash(int, int)">calcHash</a></strong>(int firstQuad, 265 int secondQuad)</code> </td> 266</tr> 267<tr class="altColor"> 268<td class="colFirst"><code>protected static int[]</code></td> 269<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#calcQuads(byte[])">calcQuads</a></strong>(byte[] wordBytes)</code> </td> 270</tr> 271<tr class="rowColor"> 272<td class="colFirst"><code>int</code></td> 273<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#collisionCount()">collisionCount</a></strong>()</code> 274<div class="block">Method mostly needed by unit tests; calculates number of 275 entries that are in collision list.</div> 276</td> 277</tr> 278<tr class="altColor"> 279<td class="colFirst"><code>static <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a></code></td> 280<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#createRoot()">createRoot</a></strong>()</code> 281<div class="block">Factory method to call to create a symbol table instance with a 282 randomized seed value.</div> 283</td> 284</tr> 285<tr class="rowColor"> 286<td class="colFirst"><code>protected static <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a></code></td> 287<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#createRoot(int)">createRoot</a></strong>(int hashSeed)</code> 288<div class="block">Factory method that should only be called from unit tests, where seed 289 value should remain the same.</div> 290</td> 291</tr> 292<tr class="altColor"> 293<td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a></code></td> 294<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#findName(int)">findName</a></strong>(int firstQuad)</code> 295<div class="block">Finds and returns name matching the specified symbol, if such 296 name already exists in the table.</div> 297</td> 298</tr> 299<tr class="rowColor"> 300<td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a></code></td> 301<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#findName(int[], int)">findName</a></strong>(int[] quads, 302 int qlen)</code> 303<div class="block">Finds and returns name matching the specified symbol, if such 304 name already exists in the table; or if not, creates name object, 305 adds to the table, and returns it.</div> 306</td> 307</tr> 308<tr class="altColor"> 309<td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a></code></td> 310<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#findName(int, int)">findName</a></strong>(int firstQuad, 311 int secondQuad)</code> 312<div class="block">Finds and returns name matching the specified symbol, if such 313 name already exists in the table.</div> 314</td> 315</tr> 316<tr class="rowColor"> 317<td class="colFirst"><code>static <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a></code></td> 318<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#getEmptyName()">getEmptyName</a></strong>()</code> </td> 319</tr> 320<tr class="altColor"> 321<td class="colFirst"><code>int</code></td> 322<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#hashSeed()">hashSeed</a></strong>()</code> </td> 323</tr> 324<tr class="rowColor"> 325<td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a></code></td> 326<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#makeChild(boolean, boolean)">makeChild</a></strong>(boolean canonicalize, 327 boolean intern)</code> 328<div class="block">Factory method used to create actual symbol table instance to 329 use for parsing.</div> 330</td> 331</tr> 332<tr class="altColor"> 333<td class="colFirst"><code>int</code></td> 334<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#maxCollisionLength()">maxCollisionLength</a></strong>()</code> 335<div class="block">Method mostly needed by unit tests; calculates length of the 336 longest collision chain.</div> 337</td> 338</tr> 339<tr class="rowColor"> 340<td class="colFirst"><code>boolean</code></td> 341<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#maybeDirty()">maybeDirty</a></strong>()</code> 342<div class="block">Method called to check to quickly see if a child symbol table 343 may have gotten additional entries.</div> 344</td> 345</tr> 346<tr class="altColor"> 347<td class="colFirst"><code>void</code></td> 348<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#release()">release</a></strong>()</code> 349<div class="block">Method called by the using code to indicate it is done 350 with this instance.</div> 351</td> 352</tr> 353<tr class="rowColor"> 354<td class="colFirst"><code>protected void</code></td> 355<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#reportTooManyCollisions(int)">reportTooManyCollisions</a></strong>(int maxLen)</code> </td> 356</tr> 357<tr class="altColor"> 358<td class="colFirst"><code>int</code></td> 359<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#size()">size</a></strong>()</code> </td> 360</tr> 361</table> 362<ul class="blockList"> 363<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> 364<!-- --> 365</a> 366<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> 367<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> 368</ul> 369</li> 370</ul> 371</li> 372</ul> 373</div> 374<div class="details"> 375<ul class="blockList"> 376<li class="blockList"> 377<!-- ============ FIELD DETAIL =========== --> 378<ul class="blockList"> 379<li class="blockList"><a name="field_detail"> 380<!-- --> 381</a> 382<h3>Field Detail</h3> 383<a name="DEFAULT_TABLE_SIZE"> 384<!-- --> 385</a> 386<ul class="blockList"> 387<li class="blockList"> 388<h4>DEFAULT_TABLE_SIZE</h4> 389<pre>protected static final int DEFAULT_TABLE_SIZE</pre> 390<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.codehaus.jackson.sym.BytesToNameCanonicalizer.DEFAULT_TABLE_SIZE">Constant Field Values</a></dd></dl> 391</li> 392</ul> 393<a name="MAX_TABLE_SIZE"> 394<!-- --> 395</a> 396<ul class="blockList"> 397<li class="blockList"> 398<h4>MAX_TABLE_SIZE</h4> 399<pre>protected static final int MAX_TABLE_SIZE</pre> 400<div class="block">Let's not expand symbol tables past some maximum size; 401 this should protected against OOMEs caused by large documents 402 with unique (~= random) names.</div> 403<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.codehaus.jackson.sym.BytesToNameCanonicalizer.MAX_TABLE_SIZE">Constant Field Values</a></dd></dl> 404</li> 405</ul> 406<a name="_parent"> 407<!-- --> 408</a> 409<ul class="blockList"> 410<li class="blockList"> 411<h4>_parent</h4> 412<pre>protected final <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a> _parent</pre> 413<div class="block">Reference to the root symbol table, for child tables, so 414 that they can merge table information back as necessary.</div> 415</li> 416</ul> 417<a name="_tableInfo"> 418<!-- --> 419</a> 420<ul class="blockList"> 421<li class="blockList"> 422<h4>_tableInfo</h4> 423<pre>protected final <a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/atomic/AtomicReference.html?is-external=true" title="class or interface in java.util.concurrent.atomic">AtomicReference</a><org.codehaus.jackson.sym.BytesToNameCanonicalizer.TableInfo> _tableInfo</pre> 424<div class="block">Member that is only used by the root table instance: root 425 passes immutable state into child instances, and children 426 may return new state if they add entries to the table. 427 Child tables do NOT use the reference.</div> 428</li> 429</ul> 430<a name="_intern"> 431<!-- --> 432</a> 433<ul class="blockList"> 434<li class="blockList"> 435<h4>_intern</h4> 436<pre>protected final boolean _intern</pre> 437<div class="block">Whether canonical symbol Strings are to be intern()ed before added 438 to the table or not</div> 439</li> 440</ul> 441<a name="_count"> 442<!-- --> 443</a> 444<ul class="blockList"> 445<li class="blockList"> 446<h4>_count</h4> 447<pre>protected int _count</pre> 448<div class="block">Total number of Names in the symbol table; 449 only used for child tables.</div> 450</li> 451</ul> 452<a name="_longestCollisionList"> 453<!-- --> 454</a> 455<ul class="blockList"> 456<li class="blockList"> 457<h4>_longestCollisionList</h4> 458<pre>protected int _longestCollisionList</pre> 459<div class="block">We need to keep track of the longest collision list; this is needed 460 both to indicate problems with attacks and to allow flushing for 461 other cases.</div> 462<dl><dt><span class="strong">Since:</span></dt> 463 <dd>1.9.9</dd></dl> 464</li> 465</ul> 466<a name="_mainHashMask"> 467<!-- --> 468</a> 469<ul class="blockList"> 470<li class="blockList"> 471<h4>_mainHashMask</h4> 472<pre>protected int _mainHashMask</pre> 473<div class="block">Mask used to truncate 32-bit hash value to current hash array 474 size; essentially, hash array size - 1 (since hash array sizes 475 are 2^N).</div> 476</li> 477</ul> 478<a name="_mainHash"> 479<!-- --> 480</a> 481<ul class="blockList"> 482<li class="blockList"> 483<h4>_mainHash</h4> 484<pre>protected int[] _mainHash</pre> 485<div class="block">Array of 2^N size, which contains combination 486 of 24-bits of hash (0 to indicate 'empty' slot), 487 and 8-bit collision bucket index (0 to indicate empty 488 collision bucket chain; otherwise subtract one from index)</div> 489</li> 490</ul> 491<a name="_mainNames"> 492<!-- --> 493</a> 494<ul class="blockList"> 495<li class="blockList"> 496<h4>_mainNames</h4> 497<pre>protected <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a>[] _mainNames</pre> 498<div class="block">Array that contains <code>Name</code> instances matching 499 entries in <code>_mainHash</code>. Contains nulls for unused 500 entries.</div> 501</li> 502</ul> 503<a name="_collList"> 504<!-- --> 505</a> 506<ul class="blockList"> 507<li class="blockList"> 508<h4>_collList</h4> 509<pre>protected org.codehaus.jackson.sym.BytesToNameCanonicalizer.Bucket[] _collList</pre> 510<div class="block">Array of heads of collision bucket chains; size dynamically</div> 511</li> 512</ul> 513<a name="_collCount"> 514<!-- --> 515</a> 516<ul class="blockList"> 517<li class="blockList"> 518<h4>_collCount</h4> 519<pre>protected int _collCount</pre> 520<div class="block">Total number of Names in collision buckets (included in 521 <code>_count</code> along with primary entries)</div> 522</li> 523</ul> 524<a name="_collEnd"> 525<!-- --> 526</a> 527<ul class="blockListLast"> 528<li class="blockList"> 529<h4>_collEnd</h4> 530<pre>protected int _collEnd</pre> 531<div class="block">Index of the first unused collision bucket entry (== size of 532 the used portion of collision list): less than 533 or equal to 0xFF (255), since max number of entries is 255 534 (8-bit, minus 0 used as 'empty' marker)</div> 535</li> 536</ul> 537</li> 538</ul> 539<!-- ============ METHOD DETAIL ========== --> 540<ul class="blockList"> 541<li class="blockList"><a name="method_detail"> 542<!-- --> 543</a> 544<h3>Method Detail</h3> 545<a name="createRoot()"> 546<!-- --> 547</a> 548<ul class="blockList"> 549<li class="blockList"> 550<h4>createRoot</h4> 551<pre>public static <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a> createRoot()</pre> 552<div class="block">Factory method to call to create a symbol table instance with a 553 randomized seed value.</div> 554</li> 555</ul> 556<a name="createRoot(int)"> 557<!-- --> 558</a> 559<ul class="blockList"> 560<li class="blockList"> 561<h4>createRoot</h4> 562<pre>protected static <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a> createRoot(int hashSeed)</pre> 563<div class="block">Factory method that should only be called from unit tests, where seed 564 value should remain the same.</div> 565</li> 566</ul> 567<a name="makeChild(boolean, boolean)"> 568<!-- --> 569</a> 570<ul class="blockList"> 571<li class="blockList"> 572<h4>makeChild</h4> 573<pre>public <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a> makeChild(boolean canonicalize, 574 boolean intern)</pre> 575<div class="block">Factory method used to create actual symbol table instance to 576 use for parsing.</div> 577<dl><dt><span class="strong">Parameters:</span></dt><dd><code>intern</code> - Whether canonical symbol Strings should be interned 578 or not</dd></dl> 579</li> 580</ul> 581<a name="release()"> 582<!-- --> 583</a> 584<ul class="blockList"> 585<li class="blockList"> 586<h4>release</h4> 587<pre>public void release()</pre> 588<div class="block">Method called by the using code to indicate it is done 589 with this instance. This lets instance merge accumulated 590 changes into parent (if need be), safely and efficiently, 591 and without calling code having to know about parent 592 information</div> 593</li> 594</ul> 595<a name="size()"> 596<!-- --> 597</a> 598<ul class="blockList"> 599<li class="blockList"> 600<h4>size</h4> 601<pre>public int size()</pre> 602</li> 603</ul> 604<a name="bucketCount()"> 605<!-- --> 606</a> 607<ul class="blockList"> 608<li class="blockList"> 609<h4>bucketCount</h4> 610<pre>public int bucketCount()</pre> 611<dl><dt><span class="strong">Since:</span></dt> 612 <dd>1.9.9</dd></dl> 613</li> 614</ul> 615<a name="maybeDirty()"> 616<!-- --> 617</a> 618<ul class="blockList"> 619<li class="blockList"> 620<h4>maybeDirty</h4> 621<pre>public boolean maybeDirty()</pre> 622<div class="block">Method called to check to quickly see if a child symbol table 623 may have gotten additional entries. Used for checking to see 624 if a child table should be merged into shared table.</div> 625</li> 626</ul> 627<a name="hashSeed()"> 628<!-- --> 629</a> 630<ul class="blockList"> 631<li class="blockList"> 632<h4>hashSeed</h4> 633<pre>public int hashSeed()</pre> 634<dl><dt><span class="strong">Since:</span></dt> 635 <dd>1.9.9</dd></dl> 636</li> 637</ul> 638<a name="collisionCount()"> 639<!-- --> 640</a> 641<ul class="blockList"> 642<li class="blockList"> 643<h4>collisionCount</h4> 644<pre>public int collisionCount()</pre> 645<div class="block">Method mostly needed by unit tests; calculates number of 646 entries that are in collision list. Value can be at most 647 (<a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#size()"><code>size()</code></a> - 1), but should usually be much lower, ideally 0.</div> 648<dl><dt><span class="strong">Since:</span></dt> 649 <dd>1.9.9</dd></dl> 650</li> 651</ul> 652<a name="maxCollisionLength()"> 653<!-- --> 654</a> 655<ul class="blockList"> 656<li class="blockList"> 657<h4>maxCollisionLength</h4> 658<pre>public int maxCollisionLength()</pre> 659<div class="block">Method mostly needed by unit tests; calculates length of the 660 longest collision chain. This should typically be a low number, 661 but may be up to <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#size()"><code>size()</code></a> - 1 in the pathological case</div> 662<dl><dt><span class="strong">Since:</span></dt> 663 <dd>1.9.9</dd></dl> 664</li> 665</ul> 666<a name="getEmptyName()"> 667<!-- --> 668</a> 669<ul class="blockList"> 670<li class="blockList"> 671<h4>getEmptyName</h4> 672<pre>public static <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a> getEmptyName()</pre> 673</li> 674</ul> 675<a name="findName(int)"> 676<!-- --> 677</a> 678<ul class="blockList"> 679<li class="blockList"> 680<h4>findName</h4> 681<pre>public <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a> findName(int firstQuad)</pre> 682<div class="block">Finds and returns name matching the specified symbol, if such 683 name already exists in the table. 684 If not, will return null. 685<p> 686 Note: separate methods to optimize common case of 687 short element/attribute names (4 or less ascii characters)</div> 688<dl><dt><span class="strong">Parameters:</span></dt><dd><code>firstQuad</code> - int32 containing first 4 bytes of the name; 689 if the whole name less than 4 bytes, padded with zero bytes 690 in front (zero MSBs, ie. right aligned)</dd> 691<dt><span class="strong">Returns:</span></dt><dd>Name matching the symbol passed (or constructed for 692 it)</dd></dl> 693</li> 694</ul> 695<a name="findName(int, int)"> 696<!-- --> 697</a> 698<ul class="blockList"> 699<li class="blockList"> 700<h4>findName</h4> 701<pre>public <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a> findName(int firstQuad, 702 int secondQuad)</pre> 703<div class="block">Finds and returns name matching the specified symbol, if such 704 name already exists in the table. 705 If not, will return null. 706<p> 707 Note: separate methods to optimize common case of relatively 708 short element/attribute names (8 or less ascii characters)</div> 709<dl><dt><span class="strong">Parameters:</span></dt><dd><code>firstQuad</code> - int32 containing first 4 bytes of the name.</dd><dd><code>secondQuad</code> - int32 containing bytes 5 through 8 of the 710 name; if less than 8 bytes, padded with up to 3 zero bytes 711 in front (zero MSBs, ie. right aligned)</dd> 712<dt><span class="strong">Returns:</span></dt><dd>Name matching the symbol passed (or constructed for it)</dd></dl> 713</li> 714</ul> 715<a name="findName(int[], int)"> 716<!-- --> 717</a> 718<ul class="blockList"> 719<li class="blockList"> 720<h4>findName</h4> 721<pre>public <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a> findName(int[] quads, 722 int qlen)</pre> 723<div class="block">Finds and returns name matching the specified symbol, if such 724 name already exists in the table; or if not, creates name object, 725 adds to the table, and returns it. 726<p> 727 Note: this is the general purpose method that can be called for 728 names of any length. However, if name is less than 9 bytes long, 729 it is preferable to call the version optimized for short 730 names.</div> 731<dl><dt><span class="strong">Parameters:</span></dt><dd><code>quads</code> - Array of int32s, each of which contain 4 bytes of 732 encoded name</dd><dd><code>qlen</code> - Number of int32s, starting from index 0, in quads 733 parameter</dd> 734<dt><span class="strong">Returns:</span></dt><dd>Name matching the symbol passed (or constructed for it)</dd></dl> 735</li> 736</ul> 737<a name="addName(java.lang.String, int, int)"> 738<!-- --> 739</a> 740<ul class="blockList"> 741<li class="blockList"> 742<h4>addName</h4> 743<pre>public <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a> addName(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> symbolStr, 744 int q1, 745 int q2)</pre> 746</li> 747</ul> 748<a name="addName(java.lang.String, int[], int)"> 749<!-- --> 750</a> 751<ul class="blockList"> 752<li class="blockList"> 753<h4>addName</h4> 754<pre>public <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a> addName(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> symbolStr, 755 int[] quads, 756 int qlen)</pre> 757</li> 758</ul> 759<a name="calcHash(int)"> 760<!-- --> 761</a> 762<ul class="blockList"> 763<li class="blockList"> 764<h4>calcHash</h4> 765<pre>public final int calcHash(int firstQuad)</pre> 766</li> 767</ul> 768<a name="calcHash(int, int)"> 769<!-- --> 770</a> 771<ul class="blockList"> 772<li class="blockList"> 773<h4>calcHash</h4> 774<pre>public final int calcHash(int firstQuad, 775 int secondQuad)</pre> 776</li> 777</ul> 778<a name="calcHash(int[], int)"> 779<!-- --> 780</a> 781<ul class="blockList"> 782<li class="blockList"> 783<h4>calcHash</h4> 784<pre>public final int calcHash(int[] quads, 785 int qlen)</pre> 786</li> 787</ul> 788<a name="calcQuads(byte[])"> 789<!-- --> 790</a> 791<ul class="blockList"> 792<li class="blockList"> 793<h4>calcQuads</h4> 794<pre>protected static int[] calcQuads(byte[] wordBytes)</pre> 795</li> 796</ul> 797<a name="reportTooManyCollisions(int)"> 798<!-- --> 799</a> 800<ul class="blockListLast"> 801<li class="blockList"> 802<h4>reportTooManyCollisions</h4> 803<pre>protected void reportTooManyCollisions(int maxLen)</pre> 804<dl><dt><span class="strong">Since:</span></dt> 805 <dd>1.9.9</dd></dl> 806</li> 807</ul> 808</li> 809</ul> 810</li> 811</ul> 812</div> 813</div> 814<!-- ========= END OF CLASS DATA ========= --> 815<!-- ======= START OF BOTTOM NAVBAR ====== --> 816<div class="bottomNav"><a name="navbar_bottom"> 817<!-- --> 818</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> 819<!-- --> 820</a> 821<ul class="navList" title="Navigation"> 822<li><a href="../../../../overview-summary.html">Overview</a></li> 823<li><a href="package-summary.html">Package</a></li> 824<li class="navBarCell1Rev">Class</li> 825<li><a href="class-use/BytesToNameCanonicalizer.html">Use</a></li> 826<li><a href="package-tree.html">Tree</a></li> 827<li><a href="../../../../deprecated-list.html">Deprecated</a></li> 828<li><a href="../../../../index-all.html">Index</a></li> 829<li><a href="../../../../help-doc.html">Help</a></li> 830</ul> 831</div> 832<div class="subNav"> 833<ul class="navList"> 834<li>Prev Class</li> 835<li><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym"><span class="strong">Next Class</span></a></li> 836</ul> 837<ul class="navList"> 838<li><a href="../../../../index.html?org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" target="_top">Frames</a></li> 839<li><a href="BytesToNameCanonicalizer.html" target="_top">No Frames</a></li> 840</ul> 841<ul class="navList" id="allclasses_navbar_bottom"> 842<li><a href="../../../../allclasses-noframe.html">All Classes</a></li> 843</ul> 844<div> 845<script type="text/javascript"><!-- 846 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 847 if(window==top) { 848 allClassesLink.style.display = "block"; 849 } 850 else { 851 allClassesLink.style.display = "none"; 852 } 853 //--> 854</script> 855</div> 856<div> 857<ul class="subNavList"> 858<li>Summary: </li> 859<li>Nested | </li> 860<li><a href="#field_summary">Field</a> | </li> 861<li>Constr | </li> 862<li><a href="#method_summary">Method</a></li> 863</ul> 864<ul class="subNavList"> 865<li>Detail: </li> 866<li><a href="#field_detail">Field</a> | </li> 867<li>Constr | </li> 868<li><a href="#method_detail">Method</a></li> 869</ul> 870</div> 871<a name="skip-navbar_bottom"> 872<!-- --> 873</a></div> 874<!-- ======== END OF BOTTOM NAVBAR ======= --> 875</body> 876</html> 877