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>NumberInput (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="NumberInput (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/NumberInput.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/io/MergedStream.html" title="class in org.codehaus.jackson.io"><span class="strong">Prev Class</span></a></li> 40<li><a href="../../../../org/codehaus/jackson/io/NumberOutput.html" title="class in org.codehaus.jackson.io"><span class="strong">Next Class</span></a></li> 41</ul> 42<ul class="navList"> 43<li><a href="../../../../index.html?org/codehaus/jackson/io/NumberInput.html" target="_top">Frames</a></li> 44<li><a href="NumberInput.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><a href="#constructor_summary">Constr</a> | </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><a href="#constructor_detail">Constr</a> | </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.io</div> 83<h2 title="Class NumberInput" class="title">Class NumberInput</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.io.NumberInput</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">NumberInput</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</li> 102</ul> 103</div> 104<div class="summary"> 105<ul class="blockList"> 106<li class="blockList"> 107<!-- =========== FIELD SUMMARY =========== --> 108<ul class="blockList"> 109<li class="blockList"><a name="field_summary"> 110<!-- --> 111</a> 112<h3>Field Summary</h3> 113<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> 114<caption><span>Fields</span><span class="tabEnd"> </span></caption> 115<tr> 116<th class="colFirst" scope="col">Modifier and Type</th> 117<th class="colLast" scope="col">Field and Description</th> 118</tr> 119<tr class="altColor"> 120<td class="colFirst"><code>static <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> 121<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/io/NumberInput.html#NASTY_SMALL_DOUBLE">NASTY_SMALL_DOUBLE</a></strong></code> 122<div class="block">Textual representation of a double constant that can cause nasty problems 123 with JDK (see http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308).</div> 124</td> 125</tr> 126</table> 127</li> 128</ul> 129<!-- ======== CONSTRUCTOR SUMMARY ======== --> 130<ul class="blockList"> 131<li class="blockList"><a name="constructor_summary"> 132<!-- --> 133</a> 134<h3>Constructor Summary</h3> 135<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> 136<caption><span>Constructors</span><span class="tabEnd"> </span></caption> 137<tr> 138<th class="colOne" scope="col">Constructor and Description</th> 139</tr> 140<tr class="altColor"> 141<td class="colOne"><code><strong><a href="../../../../org/codehaus/jackson/io/NumberInput.html#NumberInput()">NumberInput</a></strong>()</code> </td> 142</tr> 143</table> 144</li> 145</ul> 146<!-- ========== METHOD SUMMARY =========== --> 147<ul class="blockList"> 148<li class="blockList"><a name="method_summary"> 149<!-- --> 150</a> 151<h3>Method Summary</h3> 152<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> 153<caption><span>Methods</span><span class="tabEnd"> </span></caption> 154<tr> 155<th class="colFirst" scope="col">Modifier and Type</th> 156<th class="colLast" scope="col">Method and Description</th> 157</tr> 158<tr class="altColor"> 159<td class="colFirst"><code>static boolean</code></td> 160<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/io/NumberInput.html#inLongRange(char[], int, int, boolean)">inLongRange</a></strong>(char[] digitChars, 161 int offset, 162 int len, 163 boolean negative)</code> 164<div class="block">Helper method for determining if given String representation of 165 an integral number would fit in 64-bit Java long or not.</div> 166</td> 167</tr> 168<tr class="rowColor"> 169<td class="colFirst"><code>static boolean</code></td> 170<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/io/NumberInput.html#inLongRange(java.lang.String, boolean)">inLongRange</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> numberStr, 171 boolean negative)</code> 172<div class="block">Similar to <a href="../../../../org/codehaus/jackson/io/NumberInput.html#inLongRange(char[], int, int, boolean)"><code>inLongRange(char[],int,int,boolean)</code></a>, but 173 with String argument</div> 174</td> 175</tr> 176<tr class="altColor"> 177<td class="colFirst"><code>static double</code></td> 178<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/io/NumberInput.html#parseAsDouble(java.lang.String, double)">parseAsDouble</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> input, 179 double defaultValue)</code> </td> 180</tr> 181<tr class="rowColor"> 182<td class="colFirst"><code>static int</code></td> 183<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/io/NumberInput.html#parseAsInt(java.lang.String, int)">parseAsInt</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> input, 184 int defaultValue)</code> </td> 185</tr> 186<tr class="altColor"> 187<td class="colFirst"><code>static long</code></td> 188<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/io/NumberInput.html#parseAsLong(java.lang.String, long)">parseAsLong</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> input, 189 long defaultValue)</code> </td> 190</tr> 191<tr class="rowColor"> 192<td class="colFirst"><code>static double</code></td> 193<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/io/NumberInput.html#parseDouble(java.lang.String)">parseDouble</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> numStr)</code> </td> 194</tr> 195<tr class="altColor"> 196<td class="colFirst"><code>static int</code></td> 197<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/io/NumberInput.html#parseInt(char[], int, int)">parseInt</a></strong>(char[] digitChars, 198 int offset, 199 int len)</code> 200<div class="block">Fast method for parsing integers that are known to fit into 201 regular 32-bit signed int type.</div> 202</td> 203</tr> 204<tr class="rowColor"> 205<td class="colFirst"><code>static int</code></td> 206<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/io/NumberInput.html#parseInt(java.lang.String)">parseInt</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> str)</code> 207<div class="block">Helper method to (more) efficiently parse integer numbers from 208 String values.</div> 209</td> 210</tr> 211<tr class="altColor"> 212<td class="colFirst"><code>static long</code></td> 213<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/io/NumberInput.html#parseLong(char[], int, int)">parseLong</a></strong>(char[] digitChars, 214 int offset, 215 int len)</code> </td> 216</tr> 217<tr class="rowColor"> 218<td class="colFirst"><code>static long</code></td> 219<td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/io/NumberInput.html#parseLong(java.lang.String)">parseLong</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> str)</code> </td> 220</tr> 221</table> 222<ul class="blockList"> 223<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> 224<!-- --> 225</a> 226<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> 227<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> 228</ul> 229</li> 230</ul> 231</li> 232</ul> 233</div> 234<div class="details"> 235<ul class="blockList"> 236<li class="blockList"> 237<!-- ============ FIELD DETAIL =========== --> 238<ul class="blockList"> 239<li class="blockList"><a name="field_detail"> 240<!-- --> 241</a> 242<h3>Field Detail</h3> 243<a name="NASTY_SMALL_DOUBLE"> 244<!-- --> 245</a> 246<ul class="blockListLast"> 247<li class="blockList"> 248<h4>NASTY_SMALL_DOUBLE</h4> 249<pre>public static final <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> NASTY_SMALL_DOUBLE</pre> 250<div class="block">Textual representation of a double constant that can cause nasty problems 251 with JDK (see http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308).</div> 252<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.codehaus.jackson.io.NumberInput.NASTY_SMALL_DOUBLE">Constant Field Values</a></dd></dl> 253</li> 254</ul> 255</li> 256</ul> 257<!-- ========= CONSTRUCTOR DETAIL ======== --> 258<ul class="blockList"> 259<li class="blockList"><a name="constructor_detail"> 260<!-- --> 261</a> 262<h3>Constructor Detail</h3> 263<a name="NumberInput()"> 264<!-- --> 265</a> 266<ul class="blockListLast"> 267<li class="blockList"> 268<h4>NumberInput</h4> 269<pre>public NumberInput()</pre> 270</li> 271</ul> 272</li> 273</ul> 274<!-- ============ METHOD DETAIL ========== --> 275<ul class="blockList"> 276<li class="blockList"><a name="method_detail"> 277<!-- --> 278</a> 279<h3>Method Detail</h3> 280<a name="parseInt(char[], int, int)"> 281<!-- --> 282</a> 283<ul class="blockList"> 284<li class="blockList"> 285<h4>parseInt</h4> 286<pre>public static final int parseInt(char[] digitChars, 287 int offset, 288 int len)</pre> 289<div class="block">Fast method for parsing integers that are known to fit into 290 regular 32-bit signed int type. This means that length is 291 between 1 and 9 digits (inclusive) 292<p> 293 Note: public to let unit tests call it</div> 294</li> 295</ul> 296<a name="parseInt(java.lang.String)"> 297<!-- --> 298</a> 299<ul class="blockList"> 300<li class="blockList"> 301<h4>parseInt</h4> 302<pre>public static final int parseInt(<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> str)</pre> 303<div class="block">Helper method to (more) efficiently parse integer numbers from 304 String values.</div> 305<dl><dt><span class="strong">Since:</span></dt> 306 <dd>1.7</dd></dl> 307</li> 308</ul> 309<a name="parseLong(char[], int, int)"> 310<!-- --> 311</a> 312<ul class="blockList"> 313<li class="blockList"> 314<h4>parseLong</h4> 315<pre>public static final long parseLong(char[] digitChars, 316 int offset, 317 int len)</pre> 318</li> 319</ul> 320<a name="parseLong(java.lang.String)"> 321<!-- --> 322</a> 323<ul class="blockList"> 324<li class="blockList"> 325<h4>parseLong</h4> 326<pre>public static final long parseLong(<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> str)</pre> 327</li> 328</ul> 329<a name="inLongRange(char[], int, int, boolean)"> 330<!-- --> 331</a> 332<ul class="blockList"> 333<li class="blockList"> 334<h4>inLongRange</h4> 335<pre>public static final boolean inLongRange(char[] digitChars, 336 int offset, 337 int len, 338 boolean negative)</pre> 339<div class="block">Helper method for determining if given String representation of 340 an integral number would fit in 64-bit Java long or not. 341 Note that input String must NOT contain leading minus sign (even 342 if 'negative' is set to true).</div> 343<dl><dt><span class="strong">Parameters:</span></dt><dd><code>negative</code> - Whether original number had a minus sign (which is 344 NOT passed to this method) or not</dd></dl> 345</li> 346</ul> 347<a name="inLongRange(java.lang.String, boolean)"> 348<!-- --> 349</a> 350<ul class="blockList"> 351<li class="blockList"> 352<h4>inLongRange</h4> 353<pre>public static final boolean inLongRange(<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> numberStr, 354 boolean negative)</pre> 355<div class="block">Similar to <a href="../../../../org/codehaus/jackson/io/NumberInput.html#inLongRange(char[], int, int, boolean)"><code>inLongRange(char[],int,int,boolean)</code></a>, but 356 with String argument</div> 357<dl><dt><span class="strong">Parameters:</span></dt><dd><code>negative</code> - Whether original number had a minus sign (which is 358 NOT passed to this method) or not</dd><dt><span class="strong">Since:</span></dt> 359 <dd>1.5.0</dd></dl> 360</li> 361</ul> 362<a name="parseAsInt(java.lang.String, int)"> 363<!-- --> 364</a> 365<ul class="blockList"> 366<li class="blockList"> 367<h4>parseAsInt</h4> 368<pre>public static int parseAsInt(<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> input, 369 int defaultValue)</pre> 370<dl><dt><span class="strong">Since:</span></dt> 371 <dd>1.6</dd></dl> 372</li> 373</ul> 374<a name="parseAsLong(java.lang.String, long)"> 375<!-- --> 376</a> 377<ul class="blockList"> 378<li class="blockList"> 379<h4>parseAsLong</h4> 380<pre>public static long parseAsLong(<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> input, 381 long defaultValue)</pre> 382<dl><dt><span class="strong">Since:</span></dt> 383 <dd>1.6</dd></dl> 384</li> 385</ul> 386<a name="parseAsDouble(java.lang.String, double)"> 387<!-- --> 388</a> 389<ul class="blockList"> 390<li class="blockList"> 391<h4>parseAsDouble</h4> 392<pre>public static double parseAsDouble(<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> input, 393 double defaultValue)</pre> 394<dl><dt><span class="strong">Since:</span></dt> 395 <dd>1.6</dd></dl> 396</li> 397</ul> 398<a name="parseDouble(java.lang.String)"> 399<!-- --> 400</a> 401<ul class="blockListLast"> 402<li class="blockList"> 403<h4>parseDouble</h4> 404<pre>public static final double parseDouble(<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> numStr) 405 throws <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</a></pre> 406<dl><dt><span class="strong">Throws:</span></dt> 407<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</a></code></dd><dt><span class="strong">Since:</span></dt> 408 <dd>1.8</dd></dl> 409</li> 410</ul> 411</li> 412</ul> 413</li> 414</ul> 415</div> 416</div> 417<!-- ========= END OF CLASS DATA ========= --> 418<!-- ======= START OF BOTTOM NAVBAR ====== --> 419<div class="bottomNav"><a name="navbar_bottom"> 420<!-- --> 421</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> 422<!-- --> 423</a> 424<ul class="navList" title="Navigation"> 425<li><a href="../../../../overview-summary.html">Overview</a></li> 426<li><a href="package-summary.html">Package</a></li> 427<li class="navBarCell1Rev">Class</li> 428<li><a href="class-use/NumberInput.html">Use</a></li> 429<li><a href="package-tree.html">Tree</a></li> 430<li><a href="../../../../deprecated-list.html">Deprecated</a></li> 431<li><a href="../../../../index-all.html">Index</a></li> 432<li><a href="../../../../help-doc.html">Help</a></li> 433</ul> 434</div> 435<div class="subNav"> 436<ul class="navList"> 437<li><a href="../../../../org/codehaus/jackson/io/MergedStream.html" title="class in org.codehaus.jackson.io"><span class="strong">Prev Class</span></a></li> 438<li><a href="../../../../org/codehaus/jackson/io/NumberOutput.html" title="class in org.codehaus.jackson.io"><span class="strong">Next Class</span></a></li> 439</ul> 440<ul class="navList"> 441<li><a href="../../../../index.html?org/codehaus/jackson/io/NumberInput.html" target="_top">Frames</a></li> 442<li><a href="NumberInput.html" target="_top">No Frames</a></li> 443</ul> 444<ul class="navList" id="allclasses_navbar_bottom"> 445<li><a href="../../../../allclasses-noframe.html">All Classes</a></li> 446</ul> 447<div> 448<script type="text/javascript"><!-- 449 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 450 if(window==top) { 451 allClassesLink.style.display = "block"; 452 } 453 else { 454 allClassesLink.style.display = "none"; 455 } 456 //--> 457</script> 458</div> 459<div> 460<ul class="subNavList"> 461<li>Summary: </li> 462<li>Nested | </li> 463<li><a href="#field_summary">Field</a> | </li> 464<li><a href="#constructor_summary">Constr</a> | </li> 465<li><a href="#method_summary">Method</a></li> 466</ul> 467<ul class="subNavList"> 468<li>Detail: </li> 469<li><a href="#field_detail">Field</a> | </li> 470<li><a href="#constructor_detail">Constr</a> | </li> 471<li><a href="#method_detail">Method</a></li> 472</ul> 473</div> 474<a name="skip-navbar_bottom"> 475<!-- --> 476</a></div> 477<!-- ======== END OF BOTTOM NAVBAR ======= --> 478</body> 479</html> 480