<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_10-ea) on Sun Jul 14 20:03:24 PDT 2013 --> <title>BytesToNameCanonicalizer (Jackson JSON Processor)</title> <meta name="date" content="2013-07-14"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="BytesToNameCanonicalizer (Jackson JSON Processor)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/BytesToNameCanonicalizer.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev Class</li> <li><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" target="_top">Frames</a></li> <li><a href="BytesToNameCanonicalizer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#field_summary">Field</a> | </li> <li>Constr | </li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field_detail">Field</a> | </li> <li>Constr | </li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.codehaus.jackson.sym</div> <h2 title="Class BytesToNameCanonicalizer" class="title">Class BytesToNameCanonicalizer</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li>org.codehaus.jackson.sym.BytesToNameCanonicalizer</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public final class <span class="strong">BytesToNameCanonicalizer</span> extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> <div class="block">A caching symbol table implementation used for canonicalizing JSON field 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 input source). Complications arise from trying to do efficient reuse and merging of symbol tables, to be able to make use of usually shared vocabulary of subsequent parsing runs.</div> <dl><dt><span class="strong">Author:</span></dt> <dd>Tatu Saloranta</dd></dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field_summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>protected int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_collCount">_collCount</a></strong></code> <div class="block">Total number of Names in collision buckets (included in <code>_count</code> along with primary entries)</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_collEnd">_collEnd</a></strong></code> <div class="block">Index of the first unused collision bucket entry (== size of the used portion of collision list): less than or equal to 0xFF (255), since max number of entries is 255 (8-bit, minus 0 used as 'empty' marker)</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected org.codehaus.jackson.sym.BytesToNameCanonicalizer.Bucket[]</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_collList">_collList</a></strong></code> <div class="block">Array of heads of collision bucket chains; size dynamically</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_count">_count</a></strong></code> <div class="block">Total number of Names in the symbol table; only used for child tables.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected boolean</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_intern">_intern</a></strong></code> <div class="block">Whether canonical symbol Strings are to be intern()ed before added to the table or not</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_longestCollisionList">_longestCollisionList</a></strong></code> <div class="block">We need to keep track of the longest collision list; this is needed both to indicate problems with attacks and to allow flushing for other cases.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected int[]</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_mainHash">_mainHash</a></strong></code> <div class="block">Array of 2^N size, which contains combination of 24-bits of hash (0 to indicate 'empty' slot), and 8-bit collision bucket index (0 to indicate empty collision bucket chain; otherwise subtract one from index)</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_mainHashMask">_mainHashMask</a></strong></code> <div class="block">Mask used to truncate 32-bit hash value to current hash array size; essentially, hash array size - 1 (since hash array sizes are 2^N).</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a>[]</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_mainNames">_mainNames</a></strong></code> <div class="block">Array that contains <code>Name</code> instances matching entries in <code>_mainHash</code>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_parent">_parent</a></strong></code> <div class="block">Reference to the root symbol table, for child tables, so that they can merge table information back as necessary.</div> </td> </tr> <tr class="altColor"> <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> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#_tableInfo">_tableInfo</a></strong></code> <div class="block">Member that is only used by the root table instance: root passes immutable state into child instances, and children may return new state if they add entries to the table.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected static int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#DEFAULT_TABLE_SIZE">DEFAULT_TABLE_SIZE</a></strong></code> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected static int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#MAX_TABLE_SIZE">MAX_TABLE_SIZE</a></strong></code> <div class="block">Let's not expand symbol tables past some maximum size; this should protected against OOMEs caused by large documents with unique (~= random) names.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a></code></td> <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, int[] quads, int qlen)</code> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a></code></td> <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, int q1, int q2)</code> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#bucketCount()">bucketCount</a></strong>()</code> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#calcHash(int)">calcHash</a></strong>(int firstQuad)</code> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#calcHash(int[], int)">calcHash</a></strong>(int[] quads, int qlen)</code> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#calcHash(int, int)">calcHash</a></strong>(int firstQuad, int secondQuad)</code> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected static int[]</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#calcQuads(byte[])">calcQuads</a></strong>(byte[] wordBytes)</code> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#collisionCount()">collisionCount</a></strong>()</code> <div class="block">Method mostly needed by unit tests; calculates number of entries that are in collision list.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#createRoot()">createRoot</a></strong>()</code> <div class="block">Factory method to call to create a symbol table instance with a randomized seed value.</div> </td> </tr> <tr class="rowColor"> <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> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#createRoot(int)">createRoot</a></strong>(int hashSeed)</code> <div class="block">Factory method that should only be called from unit tests, where seed value should remain the same.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#findName(int)">findName</a></strong>(int firstQuad)</code> <div class="block">Finds and returns name matching the specified symbol, if such name already exists in the table.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#findName(int[], int)">findName</a></strong>(int[] quads, int qlen)</code> <div class="block">Finds and returns name matching the specified symbol, if such name already exists in the table; or if not, creates name object, adds to the table, and returns it.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#findName(int, int)">findName</a></strong>(int firstQuad, int secondQuad)</code> <div class="block">Finds and returns name matching the specified symbol, if such name already exists in the table.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#getEmptyName()">getEmptyName</a></strong>()</code> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#hashSeed()">hashSeed</a></strong>()</code> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#makeChild(boolean, boolean)">makeChild</a></strong>(boolean canonicalize, boolean intern)</code> <div class="block">Factory method used to create actual symbol table instance to use for parsing.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#maxCollisionLength()">maxCollisionLength</a></strong>()</code> <div class="block">Method mostly needed by unit tests; calculates length of the longest collision chain.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#maybeDirty()">maybeDirty</a></strong>()</code> <div class="block">Method called to check to quickly see if a child symbol table may have gotten additional entries.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#release()">release</a></strong>()</code> <div class="block">Method called by the using code to indicate it is done with this instance.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#reportTooManyCollisions(int)">reportTooManyCollisions</a></strong>(int maxLen)</code> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#size()">size</a></strong>()</code> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <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> <code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field_detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="DEFAULT_TABLE_SIZE"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>DEFAULT_TABLE_SIZE</h4> <pre>protected static final int DEFAULT_TABLE_SIZE</pre> <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> </li> </ul> <a name="MAX_TABLE_SIZE"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MAX_TABLE_SIZE</h4> <pre>protected static final int MAX_TABLE_SIZE</pre> <div class="block">Let's not expand symbol tables past some maximum size; this should protected against OOMEs caused by large documents with unique (~= random) names.</div> <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> </li> </ul> <a name="_parent"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_parent</h4> <pre>protected final <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a> _parent</pre> <div class="block">Reference to the root symbol table, for child tables, so that they can merge table information back as necessary.</div> </li> </ul> <a name="_tableInfo"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_tableInfo</h4> <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> <div class="block">Member that is only used by the root table instance: root passes immutable state into child instances, and children may return new state if they add entries to the table. Child tables do NOT use the reference.</div> </li> </ul> <a name="_intern"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_intern</h4> <pre>protected final boolean _intern</pre> <div class="block">Whether canonical symbol Strings are to be intern()ed before added to the table or not</div> </li> </ul> <a name="_count"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_count</h4> <pre>protected int _count</pre> <div class="block">Total number of Names in the symbol table; only used for child tables.</div> </li> </ul> <a name="_longestCollisionList"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_longestCollisionList</h4> <pre>protected int _longestCollisionList</pre> <div class="block">We need to keep track of the longest collision list; this is needed both to indicate problems with attacks and to allow flushing for other cases.</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.9.9</dd></dl> </li> </ul> <a name="_mainHashMask"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_mainHashMask</h4> <pre>protected int _mainHashMask</pre> <div class="block">Mask used to truncate 32-bit hash value to current hash array size; essentially, hash array size - 1 (since hash array sizes are 2^N).</div> </li> </ul> <a name="_mainHash"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_mainHash</h4> <pre>protected int[] _mainHash</pre> <div class="block">Array of 2^N size, which contains combination of 24-bits of hash (0 to indicate 'empty' slot), and 8-bit collision bucket index (0 to indicate empty collision bucket chain; otherwise subtract one from index)</div> </li> </ul> <a name="_mainNames"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_mainNames</h4> <pre>protected <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a>[] _mainNames</pre> <div class="block">Array that contains <code>Name</code> instances matching entries in <code>_mainHash</code>. Contains nulls for unused entries.</div> </li> </ul> <a name="_collList"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_collList</h4> <pre>protected org.codehaus.jackson.sym.BytesToNameCanonicalizer.Bucket[] _collList</pre> <div class="block">Array of heads of collision bucket chains; size dynamically</div> </li> </ul> <a name="_collCount"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_collCount</h4> <pre>protected int _collCount</pre> <div class="block">Total number of Names in collision buckets (included in <code>_count</code> along with primary entries)</div> </li> </ul> <a name="_collEnd"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>_collEnd</h4> <pre>protected int _collEnd</pre> <div class="block">Index of the first unused collision bucket entry (== size of the used portion of collision list): less than or equal to 0xFF (255), since max number of entries is 255 (8-bit, minus 0 used as 'empty' marker)</div> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="createRoot()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createRoot</h4> <pre>public static <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a> createRoot()</pre> <div class="block">Factory method to call to create a symbol table instance with a randomized seed value.</div> </li> </ul> <a name="createRoot(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createRoot</h4> <pre>protected static <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a> createRoot(int hashSeed)</pre> <div class="block">Factory method that should only be called from unit tests, where seed value should remain the same.</div> </li> </ul> <a name="makeChild(boolean, boolean)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>makeChild</h4> <pre>public <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym">BytesToNameCanonicalizer</a> makeChild(boolean canonicalize, boolean intern)</pre> <div class="block">Factory method used to create actual symbol table instance to use for parsing.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>intern</code> - Whether canonical symbol Strings should be interned or not</dd></dl> </li> </ul> <a name="release()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>release</h4> <pre>public void release()</pre> <div class="block">Method called by the using code to indicate it is done with this instance. This lets instance merge accumulated changes into parent (if need be), safely and efficiently, and without calling code having to know about parent information</div> </li> </ul> <a name="size()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>size</h4> <pre>public int size()</pre> </li> </ul> <a name="bucketCount()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>bucketCount</h4> <pre>public int bucketCount()</pre> <dl><dt><span class="strong">Since:</span></dt> <dd>1.9.9</dd></dl> </li> </ul> <a name="maybeDirty()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>maybeDirty</h4> <pre>public boolean maybeDirty()</pre> <div class="block">Method called to check to quickly see if a child symbol table may have gotten additional entries. Used for checking to see if a child table should be merged into shared table.</div> </li> </ul> <a name="hashSeed()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>hashSeed</h4> <pre>public int hashSeed()</pre> <dl><dt><span class="strong">Since:</span></dt> <dd>1.9.9</dd></dl> </li> </ul> <a name="collisionCount()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>collisionCount</h4> <pre>public int collisionCount()</pre> <div class="block">Method mostly needed by unit tests; calculates number of entries that are in collision list. Value can be at most (<a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#size()"><code>size()</code></a> - 1), but should usually be much lower, ideally 0.</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.9.9</dd></dl> </li> </ul> <a name="maxCollisionLength()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>maxCollisionLength</h4> <pre>public int maxCollisionLength()</pre> <div class="block">Method mostly needed by unit tests; calculates length of the longest collision chain. This should typically be a low number, but may be up to <a href="../../../../org/codehaus/jackson/sym/BytesToNameCanonicalizer.html#size()"><code>size()</code></a> - 1 in the pathological case</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.9.9</dd></dl> </li> </ul> <a name="getEmptyName()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getEmptyName</h4> <pre>public static <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a> getEmptyName()</pre> </li> </ul> <a name="findName(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>findName</h4> <pre>public <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a> findName(int firstQuad)</pre> <div class="block">Finds and returns name matching the specified symbol, if such name already exists in the table. If not, will return null. <p> Note: separate methods to optimize common case of short element/attribute names (4 or less ascii characters)</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>firstQuad</code> - int32 containing first 4 bytes of the name; if the whole name less than 4 bytes, padded with zero bytes in front (zero MSBs, ie. right aligned)</dd> <dt><span class="strong">Returns:</span></dt><dd>Name matching the symbol passed (or constructed for it)</dd></dl> </li> </ul> <a name="findName(int, int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>findName</h4> <pre>public <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a> findName(int firstQuad, int secondQuad)</pre> <div class="block">Finds and returns name matching the specified symbol, if such name already exists in the table. If not, will return null. <p> Note: separate methods to optimize common case of relatively short element/attribute names (8 or less ascii characters)</div> <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 name; if less than 8 bytes, padded with up to 3 zero bytes in front (zero MSBs, ie. right aligned)</dd> <dt><span class="strong">Returns:</span></dt><dd>Name matching the symbol passed (or constructed for it)</dd></dl> </li> </ul> <a name="findName(int[], int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>findName</h4> <pre>public <a href="../../../../org/codehaus/jackson/sym/Name.html" title="class in org.codehaus.jackson.sym">Name</a> findName(int[] quads, int qlen)</pre> <div class="block">Finds and returns name matching the specified symbol, if such name already exists in the table; or if not, creates name object, adds to the table, and returns it. <p> Note: this is the general purpose method that can be called for names of any length. However, if name is less than 9 bytes long, it is preferable to call the version optimized for short names.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>quads</code> - Array of int32s, each of which contain 4 bytes of encoded name</dd><dd><code>qlen</code> - Number of int32s, starting from index 0, in quads parameter</dd> <dt><span class="strong">Returns:</span></dt><dd>Name matching the symbol passed (or constructed for it)</dd></dl> </li> </ul> <a name="addName(java.lang.String, int, int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>addName</h4> <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, int q1, int q2)</pre> </li> </ul> <a name="addName(java.lang.String, int[], int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>addName</h4> <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, int[] quads, int qlen)</pre> </li> </ul> <a name="calcHash(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>calcHash</h4> <pre>public final int calcHash(int firstQuad)</pre> </li> </ul> <a name="calcHash(int, int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>calcHash</h4> <pre>public final int calcHash(int firstQuad, int secondQuad)</pre> </li> </ul> <a name="calcHash(int[], int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>calcHash</h4> <pre>public final int calcHash(int[] quads, int qlen)</pre> </li> </ul> <a name="calcQuads(byte[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>calcQuads</h4> <pre>protected static int[] calcQuads(byte[] wordBytes)</pre> </li> </ul> <a name="reportTooManyCollisions(int)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>reportTooManyCollisions</h4> <pre>protected void reportTooManyCollisions(int maxLen)</pre> <dl><dt><span class="strong">Since:</span></dt> <dd>1.9.9</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/BytesToNameCanonicalizer.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev Class</li> <li><a href="../../../../org/codehaus/jackson/sym/CharsToNameCanonicalizer.html" title="class in org.codehaus.jackson.sym"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/codehaus/jackson/sym/BytesToNameCanonicalizer.html" target="_top">Frames</a></li> <li><a href="BytesToNameCanonicalizer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#field_summary">Field</a> | </li> <li>Constr | </li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field_detail">Field</a> | </li> <li>Constr | </li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>