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>CharsToNameCanonicalizer (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="CharsToNameCanonicalizer (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/CharsToNameCanonicalizer.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><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym"><span class="strong">Prev Class</span></a></li> 40<li><a href="../../../../org/codehaus/jackson/sym/Name.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/CharsToNameCanonicalizer.html" target="_top">Frames</a></li> 44<li><a href="CharsToNameCanonicalizer.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 CharsToNameCanonicalizer" class="title">Class CharsToNameCanonicalizer</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.CharsToNameCanonicalizer</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">CharsToNameCanonicalizer</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">This class is a kind of specialized type-safe Map, from char array to 102 String value. Specialization means that in addition to type-safety 103 and specific access patterns (key char array, Value optionally interned 104 String; values added on access if necessary), and that instances are 105 meant to be used concurrently, but by using well-defined mechanisms 106 to obtain such concurrently usable instances. Main use for the class 107 is to store symbol table information for things like compilers and 108 parsers; especially when number of symbols (keywords) is limited. 109<p> 110 For optimal performance, usage pattern should be one where matches 111 should be very common (especially after "warm-up"), and as with most hash-based 112 maps/sets, that hash codes are uniformly distributed. Also, collisions 113 are slightly more expensive than with HashMap or HashSet, since hash codes 114 are not used in resolving collisions; that is, equals() comparison is 115 done with all symbols in same bucket index.<br /> 116 Finally, rehashing is also more expensive, as hash codes are not 117 stored; rehashing requires all entries' hash codes to be recalculated. 118 Reason for not storing hash codes is reduced memory usage, hoping 119 for better memory locality. 120<p> 121 Usual usage pattern is to create a single "master" instance, and either 122 use that instance in sequential fashion, or to create derived "child" 123 instances, which after use, are asked to return possible symbol additions 124 to master instance. In either case benefit is that symbol table gets 125 initialized so that further uses are more efficient, as eventually all 126 symbols needed will already be in symbol table. At that point no more 127 Symbol String allocations are needed, nor changes to symbol table itself. 128<p> 129 Note that while individual SymbolTable instances are NOT thread-safe 130 (much like generic collection classes), concurrently used "child" 131 instances can be freely used without synchronization. However, using 132 master table concurrently with child instances can only be done if 133 access to master instance is read-only (i.e. no modifications done).</div> 134</li> 135</ul> 136</div> 137<div class="summary"> 138<ul class="blockList"> 139<li class="blockList"> 140<!-- =========== FIELD SUMMARY =========== --> 141<ul class="blockList"> 142<li class="blockList"><a name="field_summary"> 143<!-- --> 144</a> 145<h3>Field Summary</h3> 146<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> 147<caption><span>Fields</span><span class="tabEnd"> </span></caption> 148<tr> 149<th class="colFirst" scope="col">Modifier and Type</th> 150<th class="colLast" scope="col">Field and Description</th> 151</tr> 152<tr class="altColor"> 153<td class="colFirst"><code>protected org.codehaus.jackson.sym.CharsToNameCanonicalizer.Bucket[]</code></td> 154<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#_buckets">_buckets</a></strong></code> 155<div class="block">Overflow buckets; if primary doesn't match, lookup is done 156 from here.</div> 157</td> 158</tr> 159<tr class="rowColor"> 160<td class="colFirst"><code>protected boolean</code></td> 161<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#_canonicalize">_canonicalize</a></strong></code> 162<div class="block">Whether any canonicalization should be attempted (whether using 163 intern or not)</div> 164</td> 165</tr> 166<tr class="altColor"> 167<td class="colFirst"><code>protected boolean</code></td> 168<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#_dirty">_dirty</a></strong></code> 169<div class="block">Flag that indicates if any changes have been made to the data; 170 used to both determine if bucket array needs to be copied when 171 (first) change is made, and potentially if updated bucket list 172 is to be resync'ed back to master instance.</div> 173</td> 174</tr> 175<tr class="rowColor"> 176<td class="colFirst"><code>protected int</code></td> 177<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#_indexMask">_indexMask</a></strong></code> 178<div class="block">Mask used to get index from hash values; equal to 179 <code>_buckets.length - 1</code>, when _buckets.length is 180 a power of two.</div> 181</td> 182</tr> 183<tr class="altColor"> 184<td class="colFirst"><code>protected boolean</code></td> 185<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#_intern">_intern</a></strong></code> 186<div class="block">Whether canonical symbol Strings are to be intern()ed before added 187 to the table or not</div> 188</td> 189</tr> 190<tr class="rowColor"> 191<td class="colFirst"><code>protected int</code></td> 192<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#_longestCollisionList">_longestCollisionList</a></strong></code> 193<div class="block">We need to keep track of the longest collision list; this is needed 194 both to indicate problems with attacks and to allow flushing for 195 other cases.</div> 196</td> 197</tr> 198<tr class="altColor"> 199<td class="colFirst"><code>protected <a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">CharsToNameCanonicalizer</a></code></td> 200<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#_parent">_parent</a></strong></code> 201<div class="block">Sharing of learnt symbols is done by optional linking of symbol 202 table instances with their parents.</div> 203</td> 204</tr> 205<tr class="rowColor"> 206<td class="colFirst"><code>protected int</code></td> 207<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#_size">_size</a></strong></code> 208<div class="block">Current size (number of entries); needed to know if and when 209 rehash.</div> 210</td> 211</tr> 212<tr class="altColor"> 213<td class="colFirst"><code>protected int</code></td> 214<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#_sizeThreshold">_sizeThreshold</a></strong></code> 215<div class="block">Limit that indicates maximum size this instance can hold before 216 it needs to be expanded and rehashed.</div> 217</td> 218</tr> 219<tr class="rowColor"> 220<td class="colFirst"><code>protected <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>[]</code></td> 221<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#_symbols">_symbols</a></strong></code> 222<div class="block">Primary matching symbols; it's expected most match occur from 223 here.</div> 224</td> 225</tr> 226<tr class="altColor"> 227<td class="colFirst"><code>protected static int</code></td> 228<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#DEFAULT_TABLE_SIZE">DEFAULT_TABLE_SIZE</a></strong></code> 229<div class="block">Default initial table size.</div> 230</td> 231</tr> 232<tr class="rowColor"> 233<td class="colFirst"><code>static int</code></td> 234<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#HASH_MULT">HASH_MULT</a></strong></code> </td> 235</tr> 236<tr class="altColor"> 237<td class="colFirst"><code>protected static int</code></td> 238<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#MAX_TABLE_SIZE">MAX_TABLE_SIZE</a></strong></code> 239<div class="block">Let's not expand symbol tables past some maximum size; 240 this should protected against OOMEs caused by large documents 241 with uniquer (~= random) names.</div> 242</td> 243</tr> 244</table> 245</li> 246</ul> 247<!-- ========== METHOD SUMMARY =========== --> 248<ul class="blockList"> 249<li class="blockList"><a name="method_summary"> 250<!-- --> 251</a> 252<h3>Method Summary</h3> 253<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> 254<caption><span>Methods</span><span class="tabEnd"> </span></caption> 255<tr> 256<th class="colFirst" scope="col">Modifier and Type</th> 257<th class="colLast" scope="col">Method and Description</th> 258</tr> 259<tr class="altColor"> 260<td class="colFirst"><code>int</code></td> 261<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#_hashToIndex(int)">_hashToIndex</a></strong>(int rawHash)</code> 262<div class="block">Helper method that takes in a "raw" hash value, shuffles it as necessary, 263 and truncates to be used as the index.</div> 264</td> 265</tr> 266<tr class="rowColor"> 267<td class="colFirst"><code>int</code></td> 268<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#bucketCount()">bucketCount</a></strong>()</code> 269<div class="block">Method for checking number of primary hash buckets this symbol 270 table uses.</div> 271</td> 272</tr> 273<tr class="altColor"> 274<td class="colFirst"><code>int</code></td> 275<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#calcHash(char[], int, int)">calcHash</a></strong>(char[] buffer, 276 int start, 277 int len)</code> 278<div class="block">Implementation of a hashing method for variable length 279 Strings.</div> 280</td> 281</tr> 282<tr class="rowColor"> 283<td class="colFirst"><code>int</code></td> 284<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#calcHash(java.lang.String)">calcHash</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> key)</code> </td> 285</tr> 286<tr class="altColor"> 287<td class="colFirst"><code>int</code></td> 288<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#collisionCount()">collisionCount</a></strong>()</code> 289<div class="block">Method mostly needed by unit tests; calculates number of 290 entries that are in collision list.</div> 291</td> 292</tr> 293<tr class="rowColor"> 294<td class="colFirst"><code>static <a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">CharsToNameCanonicalizer</a></code></td> 295<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#createRoot()">createRoot</a></strong>()</code> 296<div class="block">Method called to create root canonicalizer for a <a href="../../../../org/codehaus/jackson/JsonFactory.html" title="class in org.codehaus.jackson"><code>JsonFactory</code></a> 297 instance.</div> 298</td> 299</tr> 300<tr class="altColor"> 301<td class="colFirst"><code>protected static <a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">CharsToNameCanonicalizer</a></code></td> 302<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#createRoot(int)">createRoot</a></strong>(int hashSeed)</code> </td> 303</tr> 304<tr class="rowColor"> 305<td class="colFirst"><code><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></code></td> 306<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#findSymbol(char[], int, int, int)">findSymbol</a></strong>(char[] buffer, 307 int start, 308 int len, 309 int h)</code> </td> 310</tr> 311<tr class="altColor"> 312<td class="colFirst"><code>int</code></td> 313<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#hashSeed()">hashSeed</a></strong>()</code> </td> 314</tr> 315<tr class="rowColor"> 316<td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">CharsToNameCanonicalizer</a></code></td> 317<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#makeChild(boolean, boolean)">makeChild</a></strong>(boolean canonicalize, 318 boolean intern)</code> 319<div class="block">"Factory" method; will create a new child instance of this symbol 320 table.</div> 321</td> 322</tr> 323<tr class="altColor"> 324<td class="colFirst"><code>int</code></td> 325<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#maxCollisionLength()">maxCollisionLength</a></strong>()</code> 326<div class="block">Method mostly needed by unit tests; calculates length of the 327 longest collision chain.</div> 328</td> 329</tr> 330<tr class="rowColor"> 331<td class="colFirst"><code>boolean</code></td> 332<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#maybeDirty()">maybeDirty</a></strong>()</code> </td> 333</tr> 334<tr class="altColor"> 335<td class="colFirst"><code>void</code></td> 336<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#release()">release</a></strong>()</code> </td> 337</tr> 338<tr class="rowColor"> 339<td class="colFirst"><code>protected void</code></td> 340<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#reportTooManyCollisions(int)">reportTooManyCollisions</a></strong>(int maxLen)</code> </td> 341</tr> 342<tr class="altColor"> 343<td class="colFirst"><code>int</code></td> 344<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#size()">size</a></strong>()</code> </td> 345</tr> 346</table> 347<ul class="blockList"> 348<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> 349<!-- --> 350</a> 351<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> 352<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> 353</ul> 354</li> 355</ul> 356</li> 357</ul> 358</div> 359<div class="details"> 360<ul class="blockList"> 361<li class="blockList"> 362<!-- ============ FIELD DETAIL =========== --> 363<ul class="blockList"> 364<li class="blockList"><a name="field_detail"> 365<!-- --> 366</a> 367<h3>Field Detail</h3> 368<a name="HASH_MULT"> 369<!-- --> 370</a> 371<ul class="blockList"> 372<li class="blockList"> 373<h4>HASH_MULT</h4> 374<pre>public static final int HASH_MULT</pre> 375<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.codehaus.jackson.sym.CharsToNameCanonicalizer.HASH_MULT">Constant Field Values</a></dd></dl> 376</li> 377</ul> 378<a name="DEFAULT_TABLE_SIZE"> 379<!-- --> 380</a> 381<ul class="blockList"> 382<li class="blockList"> 383<h4>DEFAULT_TABLE_SIZE</h4> 384<pre>protected static final int DEFAULT_TABLE_SIZE</pre> 385<div class="block">Default initial table size. Shouldn't be miniscule (as there's 386 cost to both array realloc and rehashing), but let's keep 387 it reasonably small nonetheless. For systems that properly 388 reuse factories it doesn't matter either way; but when 389 recreating factories often, initial overhead may dominate.</div> 390<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.codehaus.jackson.sym.CharsToNameCanonicalizer.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 uniquer (~= random) names.</div> 403<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.codehaus.jackson.sym.CharsToNameCanonicalizer.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 <a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">CharsToNameCanonicalizer</a> _parent</pre> 413<div class="block">Sharing of learnt symbols is done by optional linking of symbol 414 table instances with their parents. When parent linkage is 415 defined, and child instance is released (call to <code>release</code>), 416 parent's shared tables may be updated from the child instance.</div> 417</li> 418</ul> 419<a name="_intern"> 420<!-- --> 421</a> 422<ul class="blockList"> 423<li class="blockList"> 424<h4>_intern</h4> 425<pre>protected final boolean _intern</pre> 426<div class="block">Whether canonical symbol Strings are to be intern()ed before added 427 to the table or not</div> 428</li> 429</ul> 430<a name="_canonicalize"> 431<!-- --> 432</a> 433<ul class="blockList"> 434<li class="blockList"> 435<h4>_canonicalize</h4> 436<pre>protected final boolean _canonicalize</pre> 437<div class="block">Whether any canonicalization should be attempted (whether using 438 intern or not)</div> 439</li> 440</ul> 441<a name="_symbols"> 442<!-- --> 443</a> 444<ul class="blockList"> 445<li class="blockList"> 446<h4>_symbols</h4> 447<pre>protected <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>[] _symbols</pre> 448<div class="block">Primary matching symbols; it's expected most match occur from 449 here.</div> 450</li> 451</ul> 452<a name="_buckets"> 453<!-- --> 454</a> 455<ul class="blockList"> 456<li class="blockList"> 457<h4>_buckets</h4> 458<pre>protected org.codehaus.jackson.sym.CharsToNameCanonicalizer.Bucket[] _buckets</pre> 459<div class="block">Overflow buckets; if primary doesn't match, lookup is done 460 from here. 461<p> 462 Note: Number of buckets is half of number of symbol entries, on 463 assumption there's less need for buckets.</div> 464</li> 465</ul> 466<a name="_size"> 467<!-- --> 468</a> 469<ul class="blockList"> 470<li class="blockList"> 471<h4>_size</h4> 472<pre>protected int _size</pre> 473<div class="block">Current size (number of entries); needed to know if and when 474 rehash.</div> 475</li> 476</ul> 477<a name="_sizeThreshold"> 478<!-- --> 479</a> 480<ul class="blockList"> 481<li class="blockList"> 482<h4>_sizeThreshold</h4> 483<pre>protected int _sizeThreshold</pre> 484<div class="block">Limit that indicates maximum size this instance can hold before 485 it needs to be expanded and rehashed. Calculated using fill 486 factor passed in to constructor.</div> 487</li> 488</ul> 489<a name="_indexMask"> 490<!-- --> 491</a> 492<ul class="blockList"> 493<li class="blockList"> 494<h4>_indexMask</h4> 495<pre>protected int _indexMask</pre> 496<div class="block">Mask used to get index from hash values; equal to 497 <code>_buckets.length - 1</code>, when _buckets.length is 498 a power of two.</div> 499</li> 500</ul> 501<a name="_longestCollisionList"> 502<!-- --> 503</a> 504<ul class="blockList"> 505<li class="blockList"> 506<h4>_longestCollisionList</h4> 507<pre>protected int _longestCollisionList</pre> 508<div class="block">We need to keep track of the longest collision list; this is needed 509 both to indicate problems with attacks and to allow flushing for 510 other cases.</div> 511<dl><dt><span class="strong">Since:</span></dt> 512 <dd>1.9.9</dd></dl> 513</li> 514</ul> 515<a name="_dirty"> 516<!-- --> 517</a> 518<ul class="blockListLast"> 519<li class="blockList"> 520<h4>_dirty</h4> 521<pre>protected boolean _dirty</pre> 522<div class="block">Flag that indicates if any changes have been made to the data; 523 used to both determine if bucket array needs to be copied when 524 (first) change is made, and potentially if updated bucket list 525 is to be resync'ed back to master instance.</div> 526</li> 527</ul> 528</li> 529</ul> 530<!-- ============ METHOD DETAIL ========== --> 531<ul class="blockList"> 532<li class="blockList"><a name="method_detail"> 533<!-- --> 534</a> 535<h3>Method Detail</h3> 536<a name="createRoot()"> 537<!-- --> 538</a> 539<ul class="blockList"> 540<li class="blockList"> 541<h4>createRoot</h4> 542<pre>public static <a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">CharsToNameCanonicalizer</a> createRoot()</pre> 543<div class="block">Method called to create root canonicalizer for a <a href="../../../../org/codehaus/jackson/JsonFactory.html" title="class in org.codehaus.jackson"><code>JsonFactory</code></a> 544 instance. Root instance is never used directly; its main use is for 545 storing and sharing underlying symbol arrays as needed.</div> 546</li> 547</ul> 548<a name="createRoot(int)"> 549<!-- --> 550</a> 551<ul class="blockList"> 552<li class="blockList"> 553<h4>createRoot</h4> 554<pre>protected static <a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">CharsToNameCanonicalizer</a> createRoot(int hashSeed)</pre> 555</li> 556</ul> 557<a name="makeChild(boolean, boolean)"> 558<!-- --> 559</a> 560<ul class="blockList"> 561<li class="blockList"> 562<h4>makeChild</h4> 563<pre>public <a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">CharsToNameCanonicalizer</a> makeChild(boolean canonicalize, 564 boolean intern)</pre> 565<div class="block">"Factory" method; will create a new child instance of this symbol 566 table. It will be a copy-on-write instance, ie. it will only use 567 read-only copy of parent's data, but when changes are needed, a 568 copy will be created. 569<p> 570 Note: while this method is synchronized, it is generally not 571 safe to both use makeChild/mergeChild, AND to use instance 572 actively. Instead, a separate 'root' instance should be used 573 on which only makeChild/mergeChild are called, but instance itself 574 is not used as a symbol table.</div> 575</li> 576</ul> 577<a name="release()"> 578<!-- --> 579</a> 580<ul class="blockList"> 581<li class="blockList"> 582<h4>release</h4> 583<pre>public void release()</pre> 584</li> 585</ul> 586<a name="size()"> 587<!-- --> 588</a> 589<ul class="blockList"> 590<li class="blockList"> 591<h4>size</h4> 592<pre>public int size()</pre> 593</li> 594</ul> 595<a name="bucketCount()"> 596<!-- --> 597</a> 598<ul class="blockList"> 599<li class="blockList"> 600<h4>bucketCount</h4> 601<pre>public int bucketCount()</pre> 602<div class="block">Method for checking number of primary hash buckets this symbol 603 table uses.</div> 604<dl><dt><span class="strong">Since:</span></dt> 605 <dd>1.9.9</dd></dl> 606</li> 607</ul> 608<a name="maybeDirty()"> 609<!-- --> 610</a> 611<ul class="blockList"> 612<li class="blockList"> 613<h4>maybeDirty</h4> 614<pre>public boolean maybeDirty()</pre> 615</li> 616</ul> 617<a name="hashSeed()"> 618<!-- --> 619</a> 620<ul class="blockList"> 621<li class="blockList"> 622<h4>hashSeed</h4> 623<pre>public int hashSeed()</pre> 624</li> 625</ul> 626<a name="collisionCount()"> 627<!-- --> 628</a> 629<ul class="blockList"> 630<li class="blockList"> 631<h4>collisionCount</h4> 632<pre>public int collisionCount()</pre> 633<div class="block">Method mostly needed by unit tests; calculates number of 634 entries that are in collision list. Value can be at most 635 (<a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#size()"><code>size()</code></a> - 1), but should usually be much lower, ideally 0.</div> 636<dl><dt><span class="strong">Since:</span></dt> 637 <dd>1.9.9</dd></dl> 638</li> 639</ul> 640<a name="maxCollisionLength()"> 641<!-- --> 642</a> 643<ul class="blockList"> 644<li class="blockList"> 645<h4>maxCollisionLength</h4> 646<pre>public int maxCollisionLength()</pre> 647<div class="block">Method mostly needed by unit tests; calculates length of the 648 longest collision chain. This should typically be a low number, 649 but may be up to <a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html#size()"><code>size()</code></a> - 1 in the pathological case</div> 650<dl><dt><span class="strong">Since:</span></dt> 651 <dd>1.9.9</dd></dl> 652</li> 653</ul> 654<a name="findSymbol(char[], int, int, int)"> 655<!-- --> 656</a> 657<ul class="blockList"> 658<li class="blockList"> 659<h4>findSymbol</h4> 660<pre>public <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> findSymbol(char[] buffer, 661 int start, 662 int len, 663 int h)</pre> 664</li> 665</ul> 666<a name="_hashToIndex(int)"> 667<!-- --> 668</a> 669<ul class="blockList"> 670<li class="blockList"> 671<h4>_hashToIndex</h4> 672<pre>public final int _hashToIndex(int rawHash)</pre> 673<div class="block">Helper method that takes in a "raw" hash value, shuffles it as necessary, 674 and truncates to be used as the index.</div> 675</li> 676</ul> 677<a name="calcHash(char[], int, int)"> 678<!-- --> 679</a> 680<ul class="blockList"> 681<li class="blockList"> 682<h4>calcHash</h4> 683<pre>public int calcHash(char[] buffer, 684 int start, 685 int len)</pre> 686<div class="block">Implementation of a hashing method for variable length 687 Strings. Most of the time intention is that this calculation 688 is done by caller during parsing, not here; however, sometimes 689 it needs to be done for parsed "String" too.</div> 690<dl><dt><span class="strong">Parameters:</span></dt><dd><code>len</code> - Length of String; has to be at least 1 (caller guarantees 691 this pre-condition)</dd></dl> 692</li> 693</ul> 694<a name="calcHash(java.lang.String)"> 695<!-- --> 696</a> 697<ul class="blockList"> 698<li class="blockList"> 699<h4>calcHash</h4> 700<pre>public int calcHash(<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> key)</pre> 701</li> 702</ul> 703<a name="reportTooManyCollisions(int)"> 704<!-- --> 705</a> 706<ul class="blockListLast"> 707<li class="blockList"> 708<h4>reportTooManyCollisions</h4> 709<pre>protected void reportTooManyCollisions(int maxLen)</pre> 710<dl><dt><span class="strong">Since:</span></dt> 711 <dd>1.9.9</dd></dl> 712</li> 713</ul> 714</li> 715</ul> 716</li> 717</ul> 718</div> 719</div> 720<!-- ========= END OF CLASS DATA ========= --> 721<!-- ======= START OF BOTTOM NAVBAR ====== --> 722<div class="bottomNav"><a name="navbar_bottom"> 723<!-- --> 724</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> 725<!-- --> 726</a> 727<ul class="navList" title="Navigation"> 728<li><a href="../../../../overview-summary.html">Overview</a></li> 729<li><a href="package-summary.html">Package</a></li> 730<li class="navBarCell1Rev">Class</li> 731<li><a href="class-use/CharsToNameCanonicalizer.html">Use</a></li> 732<li><a href="package-tree.html">Tree</a></li> 733<li><a href="../../../../deprecated-list.html">Deprecated</a></li> 734<li><a href="../../../../index-all.html">Index</a></li> 735<li><a href="../../../../help-doc.html">Help</a></li> 736</ul> 737</div> 738<div class="subNav"> 739<ul class="navList"> 740<li><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym"><span class="strong">Prev Class</span></a></li> 741<li><a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym"><span class="strong">Next Class</span></a></li> 742</ul> 743<ul class="navList"> 744<li><a href="../../../../index.html?org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" target="_top">Frames</a></li> 745<li><a href="CharsToNameCanonicalizer.html" target="_top">No Frames</a></li> 746</ul> 747<ul class="navList" id="allclasses_navbar_bottom"> 748<li><a href="../../../../allclasses-noframe.html">All Classes</a></li> 749</ul> 750<div> 751<script type="text/javascript"><!-- 752 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 753 if(window==top) { 754 allClassesLink.style.display = "block"; 755 } 756 else { 757 allClassesLink.style.display = "none"; 758 } 759 //--> 760</script> 761</div> 762<div> 763<ul class="subNavList"> 764<li>Summary: </li> 765<li>Nested | </li> 766<li><a href="#field_summary">Field</a> | </li> 767<li>Constr | </li> 768<li><a href="#method_summary">Method</a></li> 769</ul> 770<ul class="subNavList"> 771<li>Detail: </li> 772<li><a href="#field_detail">Field</a> | </li> 773<li>Constr | </li> 774<li><a href="#method_detail">Method</a></li> 775</ul> 776</div> 777<a name="skip-navbar_bottom"> 778<!-- --> 779</a></div> 780<!-- ======== END OF BOTTOM NAVBAR ======= --> 781</body> 782</html> 783