JSONTokener.html 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="en">
  4. <head>
  5. <!-- Generated by javadoc (1.8.0_161) on Thu Aug 16 18:54:13 JST 2018 -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <title>JSONTokener (twitter4j-core 4.0.7 API)</title>
  8. <meta name="date" content="2018-08-16">
  9. <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
  10. <script type="text/javascript" src="../script.js"></script>
  11. </head>
  12. <body>
  13. <script type="text/javascript"><!--
  14. try {
  15. if (location.href.indexOf('is-external=true') == -1) {
  16. parent.document.title="JSONTokener (twitter4j-core 4.0.7 API)";
  17. }
  18. }
  19. catch(err) {
  20. }
  21. //-->
  22. var methods = {"i0":10,"i1":9,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10};
  23. var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
  24. var altColor = "altColor";
  25. var rowColor = "rowColor";
  26. var tableTab = "tableTab";
  27. var activeTableTab = "activeTableTab";
  28. </script>
  29. <noscript>
  30. <div>JavaScript is disabled on your browser.</div>
  31. </noscript>
  32. <!-- ========= START OF TOP NAVBAR ======= -->
  33. <div class="topNav"><a name="navbar.top">
  34. <!-- -->
  35. </a>
  36. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  37. <a name="navbar.top.firstrow">
  38. <!-- -->
  39. </a>
  40. <ul class="navList" title="Navigation">
  41. <li><a href="../overview-summary.html">Overview</a></li>
  42. <li><a href="package-summary.html">Package</a></li>
  43. <li class="navBarCell1Rev">Class</li>
  44. <li><a href="class-use/JSONTokener.html">Use</a></li>
  45. <li><a href="package-tree.html">Tree</a></li>
  46. <li><a href="../deprecated-list.html">Deprecated</a></li>
  47. <li><a href="../index-all.html">Index</a></li>
  48. <li><a href="../help-doc.html">Help</a></li>
  49. </ul>
  50. </div>
  51. <div class="subNav">
  52. <ul class="navList">
  53. <li><a href="../twitter4j/JSONStringer.html" title="class in twitter4j"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  54. <li><a href="../twitter4j/LanguageJSONImpl.html" title="class in twitter4j"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  55. </ul>
  56. <ul class="navList">
  57. <li><a href="../index.html?twitter4j/JSONTokener.html" target="_top">Frames</a></li>
  58. <li><a href="JSONTokener.html" target="_top">No&nbsp;Frames</a></li>
  59. </ul>
  60. <ul class="navList" id="allclasses_navbar_top">
  61. <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
  62. </ul>
  63. <div>
  64. <script type="text/javascript"><!--
  65. allClassesLink = document.getElementById("allclasses_navbar_top");
  66. if(window==top) {
  67. allClassesLink.style.display = "block";
  68. }
  69. else {
  70. allClassesLink.style.display = "none";
  71. }
  72. //-->
  73. </script>
  74. </div>
  75. <div>
  76. <ul class="subNavList">
  77. <li>Summary:&nbsp;</li>
  78. <li>Nested&nbsp;|&nbsp;</li>
  79. <li>Field&nbsp;|&nbsp;</li>
  80. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  81. <li><a href="#method.summary">Method</a></li>
  82. </ul>
  83. <ul class="subNavList">
  84. <li>Detail:&nbsp;</li>
  85. <li>Field&nbsp;|&nbsp;</li>
  86. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  87. <li><a href="#method.detail">Method</a></li>
  88. </ul>
  89. </div>
  90. <a name="skip.navbar.top">
  91. <!-- -->
  92. </a></div>
  93. <!-- ========= END OF TOP NAVBAR ========= -->
  94. <!-- ======== START OF CLASS DATA ======== -->
  95. <div class="header">
  96. <div class="subTitle">twitter4j</div>
  97. <h2 title="Class JSONTokener" class="title">Class JSONTokener</h2>
  98. </div>
  99. <div class="contentContainer">
  100. <ul class="inheritance">
  101. <li><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
  102. <li>
  103. <ul class="inheritance">
  104. <li>twitter4j.JSONTokener</li>
  105. </ul>
  106. </li>
  107. </ul>
  108. <div class="description">
  109. <ul class="blockList">
  110. <li class="blockList">
  111. <hr>
  112. <br>
  113. <pre>public class <span class="typeNameLabel">JSONTokener</span>
  114. extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
  115. <div class="block">Parses a JSON (<a href="http://www.ietf.org/rfc/rfc4627.txt">RFC 4627</a>)
  116. encoded string into the corresponding object. Most clients of
  117. this class will use only need the <a href="../twitter4j/JSONTokener.html#JSONTokener-java.lang.String-"><code>constructor</code></a>
  118. and <a href="../twitter4j/JSONTokener.html#nextValue--"><code>nextValue()</code></a> method. Example usage: <pre>
  119. String json = "{"
  120. + " \"query\": \"Pizza\", "
  121. + " \"locations\": [ 94043, 90210 ] "
  122. + "}";
  123. JSONObject object = (JSONObject) new JSONTokener(json).nextValue();
  124. String query = object.getString("query");
  125. JSONArray locations = object.getJSONArray("locations");</pre>
  126. <p>For best interoperability and performance use JSON that complies with
  127. RFC 4627, such as that generated by <a href="../twitter4j/JSONStringer.html" title="class in twitter4j"><code>JSONStringer</code></a>. For legacy reasons
  128. this parser is lenient, so a successful parse does not indicate that the
  129. input string was valid JSON. All of the following syntax errors will be
  130. ignored:
  131. <ul>
  132. <li>End of line comments starting with <code>//</code> or <code>#</code> and ending
  133. with a newline character.
  134. <li>C-style comments starting with <code>/*</code> and ending with
  135. <code>*</code><code>/</code>. Such comments may not be nested.
  136. <li>Strings that are unquoted or <code>'single quoted'</code>.
  137. <li>Hexadecimal integers prefixed with <code>0x</code> or <code>0X</code>.
  138. <li>Octal integers prefixed with <code>0</code>.
  139. <li>Array elements separated by <code>;</code>.
  140. <li>Unnecessary array separators. These are interpreted as if null was the
  141. omitted value.
  142. <li>Key-value pairs separated by <code>=</code> or <code>=&gt;</code>.
  143. <li>Key-value pairs separated by <code>;</code>.
  144. </ul>
  145. <p>Each tokener may be used to parse a single JSON string. Instances of this
  146. class are not thread safe. Although this class is nonfinal, it was not
  147. designed for inheritance and should not be subclassed. In particular,
  148. self-use by overrideable methods is not specified. See <i>Effective Java</i>
  149. Item 17, "Design and Document or inheritance or else prohibit it" for further
  150. information.</div>
  151. </li>
  152. </ul>
  153. </div>
  154. <div class="summary">
  155. <ul class="blockList">
  156. <li class="blockList">
  157. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  158. <ul class="blockList">
  159. <li class="blockList"><a name="constructor.summary">
  160. <!-- -->
  161. </a>
  162. <h3>Constructor Summary</h3>
  163. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  164. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  165. <tr>
  166. <th class="colOne" scope="col">Constructor and Description</th>
  167. </tr>
  168. <tr class="altColor">
  169. <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#JSONTokener-java.io.InputStream-">JSONTokener</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;is)</code>&nbsp;</td>
  170. </tr>
  171. <tr class="rowColor">
  172. <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#JSONTokener-java.io.Reader-">JSONTokener</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</a>&nbsp;input)</code>&nbsp;</td>
  173. </tr>
  174. <tr class="altColor">
  175. <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#JSONTokener-java.lang.String-">JSONTokener</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;in)</code>&nbsp;</td>
  176. </tr>
  177. </table>
  178. </li>
  179. </ul>
  180. <!-- ========== METHOD SUMMARY =========== -->
  181. <ul class="blockList">
  182. <li class="blockList"><a name="method.summary">
  183. <!-- -->
  184. </a>
  185. <h3>Method Summary</h3>
  186. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  187. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
  188. <tr>
  189. <th class="colFirst" scope="col">Modifier and Type</th>
  190. <th class="colLast" scope="col">Method and Description</th>
  191. </tr>
  192. <tr id="i0" class="altColor">
  193. <td class="colFirst"><code>void</code></td>
  194. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#back--">back</a></span>()</code>
  195. <div class="block">Unreads the most recent character of input.</div>
  196. </td>
  197. </tr>
  198. <tr id="i1" class="rowColor">
  199. <td class="colFirst"><code>static int</code></td>
  200. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#dehexchar-char-">dehexchar</a></span>(char&nbsp;hex)</code>
  201. <div class="block">Returns the integer [0..15] value for the given hex character, or -1
  202. for non-hex input.</div>
  203. </td>
  204. </tr>
  205. <tr id="i2" class="altColor">
  206. <td class="colFirst"><code>boolean</code></td>
  207. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#more--">more</a></span>()</code>
  208. <div class="block">Returns true until the input has been exhausted.</div>
  209. </td>
  210. </tr>
  211. <tr id="i3" class="rowColor">
  212. <td class="colFirst"><code>char</code></td>
  213. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#next--">next</a></span>()</code>
  214. <div class="block">Returns the next available character, or the null character '\0' if all
  215. input has been exhausted.</div>
  216. </td>
  217. </tr>
  218. <tr id="i4" class="altColor">
  219. <td class="colFirst"><code>char</code></td>
  220. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#next-char-">next</a></span>(char&nbsp;c)</code>
  221. <div class="block">Returns the next available character if it equals <code>c</code>.</div>
  222. </td>
  223. </tr>
  224. <tr id="i5" class="rowColor">
  225. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
  226. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#next-int-">next</a></span>(int&nbsp;length)</code>
  227. <div class="block">Returns the next <code>length</code> characters of the input.</div>
  228. </td>
  229. </tr>
  230. <tr id="i6" class="altColor">
  231. <td class="colFirst"><code>char</code></td>
  232. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#nextClean--">nextClean</a></span>()</code>
  233. <div class="block">Returns the next character that is not whitespace and does not belong to
  234. a comment.</div>
  235. </td>
  236. </tr>
  237. <tr id="i7" class="rowColor">
  238. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
  239. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#nextString-char-">nextString</a></span>(char&nbsp;quote)</code>
  240. <div class="block">Returns the string up to but not including <code>quote</code>, unescaping any
  241. character escape sequences encountered along the way.</div>
  242. </td>
  243. </tr>
  244. <tr id="i8" class="altColor">
  245. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
  246. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#nextTo-char-">nextTo</a></span>(char&nbsp;excluded)</code>
  247. <div class="block">Equivalent to <code>nextTo(String.valueOf(excluded))</code>.</div>
  248. </td>
  249. </tr>
  250. <tr id="i9" class="rowColor">
  251. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
  252. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#nextTo-java.lang.String-">nextTo</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;excluded)</code>
  253. <div class="block">Returns the <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#trim--" title="class or interface in java.lang"><code>trimmed</code></a> string holding the characters up
  254. to but not including the first of:
  255. any character in <code>excluded</code>
  256. a newline character '\n'
  257. a carriage return '\r'
  258. </div>
  259. </td>
  260. </tr>
  261. <tr id="i10" class="altColor">
  262. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
  263. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#nextValue--">nextValue</a></span>()</code>
  264. <div class="block">Returns the next value from the input.</div>
  265. </td>
  266. </tr>
  267. <tr id="i11" class="rowColor">
  268. <td class="colFirst"><code>void</code></td>
  269. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#skipPast-java.lang.String-">skipPast</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;thru)</code>
  270. <div class="block">Advances past all input up to and including the next occurrence of
  271. <code>thru</code>.</div>
  272. </td>
  273. </tr>
  274. <tr id="i12" class="altColor">
  275. <td class="colFirst"><code>char</code></td>
  276. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#skipTo-char-">skipTo</a></span>(char&nbsp;to)</code>
  277. <div class="block">Advances past all input up to but not including the next occurrence of
  278. <code>to</code>.</div>
  279. </td>
  280. </tr>
  281. <tr id="i13" class="rowColor">
  282. <td class="colFirst"><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code></td>
  283. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#syntaxError-java.lang.String-">syntaxError</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;message)</code>
  284. <div class="block">Returns an exception containing the given message plus the current
  285. position and the entire input string.</div>
  286. </td>
  287. </tr>
  288. <tr id="i14" class="altColor">
  289. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
  290. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONTokener.html#toString--">toString</a></span>()</code>
  291. <div class="block">Returns the current position and the entire input string.</div>
  292. </td>
  293. </tr>
  294. </table>
  295. <ul class="blockList">
  296. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  297. <!-- -->
  298. </a>
  299. <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
  300. <code><a href="http://docs.oracle.com/javase/8/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/8/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/8/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/8/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/8/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/8/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/8/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/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
  301. </ul>
  302. </li>
  303. </ul>
  304. </li>
  305. </ul>
  306. </div>
  307. <div class="details">
  308. <ul class="blockList">
  309. <li class="blockList">
  310. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  311. <ul class="blockList">
  312. <li class="blockList"><a name="constructor.detail">
  313. <!-- -->
  314. </a>
  315. <h3>Constructor Detail</h3>
  316. <a name="JSONTokener-java.lang.String-">
  317. <!-- -->
  318. </a>
  319. <ul class="blockList">
  320. <li class="blockList">
  321. <h4>JSONTokener</h4>
  322. <pre>public&nbsp;JSONTokener(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;in)</pre>
  323. <dl>
  324. <dt><span class="paramLabel">Parameters:</span></dt>
  325. <dd><code>in</code> - JSON encoded string. Null is not permitted and will yield a
  326. tokener that throws <code>NullPointerExceptions</code> when methods are
  327. called.</dd>
  328. </dl>
  329. </li>
  330. </ul>
  331. <a name="JSONTokener-java.io.Reader-">
  332. <!-- -->
  333. </a>
  334. <ul class="blockList">
  335. <li class="blockList">
  336. <h4>JSONTokener</h4>
  337. <pre>public&nbsp;JSONTokener(<a href="http://docs.oracle.com/javase/8/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</a>&nbsp;input)</pre>
  338. </li>
  339. </ul>
  340. <a name="JSONTokener-java.io.InputStream-">
  341. <!-- -->
  342. </a>
  343. <ul class="blockListLast">
  344. <li class="blockList">
  345. <h4>JSONTokener</h4>
  346. <pre>public&nbsp;JSONTokener(<a href="http://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;is)</pre>
  347. </li>
  348. </ul>
  349. </li>
  350. </ul>
  351. <!-- ============ METHOD DETAIL ========== -->
  352. <ul class="blockList">
  353. <li class="blockList"><a name="method.detail">
  354. <!-- -->
  355. </a>
  356. <h3>Method Detail</h3>
  357. <a name="nextValue--">
  358. <!-- -->
  359. </a>
  360. <ul class="blockList">
  361. <li class="blockList">
  362. <h4>nextValue</h4>
  363. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;nextValue()
  364. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  365. <div class="block">Returns the next value from the input.</div>
  366. <dl>
  367. <dt><span class="returnLabel">Returns:</span></dt>
  368. <dd>a <a href="../twitter4j/JSONObject.html" title="class in twitter4j"><code>JSONObject</code></a>, <a href="../twitter4j/JSONArray.html" title="class in twitter4j"><code>JSONArray</code></a>, String, Boolean,
  369. Integer, Long, Double or <a href="../twitter4j/JSONObject.html#NULL"><code>JSONObject.NULL</code></a>.</dd>
  370. <dt><span class="throwsLabel">Throws:</span></dt>
  371. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the input is malformed.</dd>
  372. </dl>
  373. </li>
  374. </ul>
  375. <a name="nextString-char-">
  376. <!-- -->
  377. </a>
  378. <ul class="blockList">
  379. <li class="blockList">
  380. <h4>nextString</h4>
  381. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;nextString(char&nbsp;quote)
  382. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  383. <div class="block">Returns the string up to but not including <code>quote</code>, unescaping any
  384. character escape sequences encountered along the way. The opening quote
  385. should have already been read. This consumes the closing quote, but does
  386. not include it in the returned string.</div>
  387. <dl>
  388. <dt><span class="paramLabel">Parameters:</span></dt>
  389. <dd><code>quote</code> - either ' or ".</dd>
  390. <dt><span class="returnLabel">Returns:</span></dt>
  391. <dd>The unescaped string.</dd>
  392. <dt><span class="throwsLabel">Throws:</span></dt>
  393. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the string isn't terminated by a closing quote correctly.</dd>
  394. </dl>
  395. </li>
  396. </ul>
  397. <a name="syntaxError-java.lang.String-">
  398. <!-- -->
  399. </a>
  400. <ul class="blockList">
  401. <li class="blockList">
  402. <h4>syntaxError</h4>
  403. <pre>public&nbsp;<a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a>&nbsp;syntaxError(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;message)</pre>
  404. <div class="block">Returns an exception containing the given message plus the current
  405. position and the entire input string.</div>
  406. <dl>
  407. <dt><span class="paramLabel">Parameters:</span></dt>
  408. <dd><code>message</code> - The message we want to include.</dd>
  409. <dt><span class="returnLabel">Returns:</span></dt>
  410. <dd>An exception that we can throw.</dd>
  411. </dl>
  412. </li>
  413. </ul>
  414. <a name="toString--">
  415. <!-- -->
  416. </a>
  417. <ul class="blockList">
  418. <li class="blockList">
  419. <h4>toString</h4>
  420. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre>
  421. <div class="block">Returns the current position and the entire input string.</div>
  422. <dl>
  423. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  424. <dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
  425. </dl>
  426. </li>
  427. </ul>
  428. <a name="more--">
  429. <!-- -->
  430. </a>
  431. <ul class="blockList">
  432. <li class="blockList">
  433. <h4>more</h4>
  434. <pre>public&nbsp;boolean&nbsp;more()</pre>
  435. <div class="block">Returns true until the input has been exhausted.</div>
  436. <dl>
  437. <dt><span class="returnLabel">Returns:</span></dt>
  438. <dd>true if more input exists.</dd>
  439. </dl>
  440. </li>
  441. </ul>
  442. <a name="next--">
  443. <!-- -->
  444. </a>
  445. <ul class="blockList">
  446. <li class="blockList">
  447. <h4>next</h4>
  448. <pre>public&nbsp;char&nbsp;next()</pre>
  449. <div class="block">Returns the next available character, or the null character '\0' if all
  450. input has been exhausted. The return value of this method is ambiguous
  451. for JSON strings that contain the character '\0'.</div>
  452. <dl>
  453. <dt><span class="returnLabel">Returns:</span></dt>
  454. <dd>the next character.</dd>
  455. </dl>
  456. </li>
  457. </ul>
  458. <a name="next-char-">
  459. <!-- -->
  460. </a>
  461. <ul class="blockList">
  462. <li class="blockList">
  463. <h4>next</h4>
  464. <pre>public&nbsp;char&nbsp;next(char&nbsp;c)
  465. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  466. <div class="block">Returns the next available character if it equals <code>c</code>. Otherwise an
  467. exception is thrown.</div>
  468. <dl>
  469. <dt><span class="paramLabel">Parameters:</span></dt>
  470. <dd><code>c</code> - The character we are looking for.</dd>
  471. <dt><span class="returnLabel">Returns:</span></dt>
  472. <dd>the next character.</dd>
  473. <dt><span class="throwsLabel">Throws:</span></dt>
  474. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - If the next character isn't <code>c</code></dd>
  475. </dl>
  476. </li>
  477. </ul>
  478. <a name="nextClean--">
  479. <!-- -->
  480. </a>
  481. <ul class="blockList">
  482. <li class="blockList">
  483. <h4>nextClean</h4>
  484. <pre>public&nbsp;char&nbsp;nextClean()
  485. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  486. <div class="block">Returns the next character that is not whitespace and does not belong to
  487. a comment. If the input is exhausted before such a character can be
  488. found, the null character '\0' is returned. The return value of this
  489. method is ambiguous for JSON strings that contain the character '\0'.</div>
  490. <dl>
  491. <dt><span class="returnLabel">Returns:</span></dt>
  492. <dd>The next non-whitespace character.</dd>
  493. <dt><span class="throwsLabel">Throws:</span></dt>
  494. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - Should not be possible.</dd>
  495. </dl>
  496. </li>
  497. </ul>
  498. <a name="next-int-">
  499. <!-- -->
  500. </a>
  501. <ul class="blockList">
  502. <li class="blockList">
  503. <h4>next</h4>
  504. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;next(int&nbsp;length)
  505. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  506. <div class="block">Returns the next <code>length</code> characters of the input.
  507. <p>The returned string shares its backing character array with this
  508. tokener's input string. If a reference to the returned string may be held
  509. indefinitely, you should use <code>new String(result)</code> to copy it first
  510. to avoid memory leaks.</div>
  511. <dl>
  512. <dt><span class="paramLabel">Parameters:</span></dt>
  513. <dd><code>length</code> - The desired number of characters to return.</dd>
  514. <dt><span class="returnLabel">Returns:</span></dt>
  515. <dd>The next few characters.</dd>
  516. <dt><span class="throwsLabel">Throws:</span></dt>
  517. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the remaining input is not long enough to
  518. satisfy this request.</dd>
  519. </dl>
  520. </li>
  521. </ul>
  522. <a name="nextTo-java.lang.String-">
  523. <!-- -->
  524. </a>
  525. <ul class="blockList">
  526. <li class="blockList">
  527. <h4>nextTo</h4>
  528. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;nextTo(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;excluded)</pre>
  529. <div class="block">Returns the <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#trim--" title="class or interface in java.lang"><code>trimmed</code></a> string holding the characters up
  530. to but not including the first of:
  531. <ul>
  532. <li>any character in <code>excluded</code>
  533. <li>a newline character '\n'
  534. <li>a carriage return '\r'
  535. </ul>
  536. <p>The returned string shares its backing character array with this
  537. tokener's input string. If a reference to the returned string may be held
  538. indefinitely, you should use <code>new String(result)</code> to copy it first
  539. to avoid memory leaks.</div>
  540. <dl>
  541. <dt><span class="paramLabel">Parameters:</span></dt>
  542. <dd><code>excluded</code> - The limiting string where the search should stop.</dd>
  543. <dt><span class="returnLabel">Returns:</span></dt>
  544. <dd>a possibly-empty string</dd>
  545. </dl>
  546. </li>
  547. </ul>
  548. <a name="nextTo-char-">
  549. <!-- -->
  550. </a>
  551. <ul class="blockList">
  552. <li class="blockList">
  553. <h4>nextTo</h4>
  554. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;nextTo(char&nbsp;excluded)</pre>
  555. <div class="block">Equivalent to <code>nextTo(String.valueOf(excluded))</code>.</div>
  556. <dl>
  557. <dt><span class="paramLabel">Parameters:</span></dt>
  558. <dd><code>excluded</code> - The limiting character.</dd>
  559. <dt><span class="returnLabel">Returns:</span></dt>
  560. <dd>a possibly-empty string</dd>
  561. </dl>
  562. </li>
  563. </ul>
  564. <a name="skipPast-java.lang.String-">
  565. <!-- -->
  566. </a>
  567. <ul class="blockList">
  568. <li class="blockList">
  569. <h4>skipPast</h4>
  570. <pre>public&nbsp;void&nbsp;skipPast(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;thru)</pre>
  571. <div class="block">Advances past all input up to and including the next occurrence of
  572. <code>thru</code>. If the remaining input doesn't contain <code>thru</code>, the
  573. input is exhausted.</div>
  574. <dl>
  575. <dt><span class="paramLabel">Parameters:</span></dt>
  576. <dd><code>thru</code> - The string to skip over.</dd>
  577. </dl>
  578. </li>
  579. </ul>
  580. <a name="skipTo-char-">
  581. <!-- -->
  582. </a>
  583. <ul class="blockList">
  584. <li class="blockList">
  585. <h4>skipTo</h4>
  586. <pre>public&nbsp;char&nbsp;skipTo(char&nbsp;to)</pre>
  587. <div class="block">Advances past all input up to but not including the next occurrence of
  588. <code>to</code>. If the remaining input doesn't contain <code>to</code>, the input
  589. is unchanged.</div>
  590. <dl>
  591. <dt><span class="paramLabel">Parameters:</span></dt>
  592. <dd><code>to</code> - The character we want to skip to.</dd>
  593. <dt><span class="returnLabel">Returns:</span></dt>
  594. <dd>The value of <code>to</code> or null.</dd>
  595. </dl>
  596. </li>
  597. </ul>
  598. <a name="back--">
  599. <!-- -->
  600. </a>
  601. <ul class="blockList">
  602. <li class="blockList">
  603. <h4>back</h4>
  604. <pre>public&nbsp;void&nbsp;back()</pre>
  605. <div class="block">Unreads the most recent character of input. If no input characters have
  606. been read, the input is unchanged.</div>
  607. </li>
  608. </ul>
  609. <a name="dehexchar-char-">
  610. <!-- -->
  611. </a>
  612. <ul class="blockListLast">
  613. <li class="blockList">
  614. <h4>dehexchar</h4>
  615. <pre>public static&nbsp;int&nbsp;dehexchar(char&nbsp;hex)</pre>
  616. <div class="block">Returns the integer [0..15] value for the given hex character, or -1
  617. for non-hex input.</div>
  618. <dl>
  619. <dt><span class="paramLabel">Parameters:</span></dt>
  620. <dd><code>hex</code> - a character in the ranges [0-9], [A-F] or [a-f]. Any other
  621. character will yield a -1 result.</dd>
  622. <dt><span class="returnLabel">Returns:</span></dt>
  623. <dd>The decoded integer.</dd>
  624. </dl>
  625. </li>
  626. </ul>
  627. </li>
  628. </ul>
  629. </li>
  630. </ul>
  631. </div>
  632. </div>
  633. <!-- ========= END OF CLASS DATA ========= -->
  634. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  635. <div class="bottomNav"><a name="navbar.bottom">
  636. <!-- -->
  637. </a>
  638. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  639. <a name="navbar.bottom.firstrow">
  640. <!-- -->
  641. </a>
  642. <ul class="navList" title="Navigation">
  643. <li><a href="../overview-summary.html">Overview</a></li>
  644. <li><a href="package-summary.html">Package</a></li>
  645. <li class="navBarCell1Rev">Class</li>
  646. <li><a href="class-use/JSONTokener.html">Use</a></li>
  647. <li><a href="package-tree.html">Tree</a></li>
  648. <li><a href="../deprecated-list.html">Deprecated</a></li>
  649. <li><a href="../index-all.html">Index</a></li>
  650. <li><a href="../help-doc.html">Help</a></li>
  651. </ul>
  652. </div>
  653. <div class="subNav">
  654. <ul class="navList">
  655. <li><a href="../twitter4j/JSONStringer.html" title="class in twitter4j"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  656. <li><a href="../twitter4j/LanguageJSONImpl.html" title="class in twitter4j"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  657. </ul>
  658. <ul class="navList">
  659. <li><a href="../index.html?twitter4j/JSONTokener.html" target="_top">Frames</a></li>
  660. <li><a href="JSONTokener.html" target="_top">No&nbsp;Frames</a></li>
  661. </ul>
  662. <ul class="navList" id="allclasses_navbar_bottom">
  663. <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
  664. </ul>
  665. <div>
  666. <script type="text/javascript"><!--
  667. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  668. if(window==top) {
  669. allClassesLink.style.display = "block";
  670. }
  671. else {
  672. allClassesLink.style.display = "none";
  673. }
  674. //-->
  675. </script>
  676. </div>
  677. <div>
  678. <ul class="subNavList">
  679. <li>Summary:&nbsp;</li>
  680. <li>Nested&nbsp;|&nbsp;</li>
  681. <li>Field&nbsp;|&nbsp;</li>
  682. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  683. <li><a href="#method.summary">Method</a></li>
  684. </ul>
  685. <ul class="subNavList">
  686. <li>Detail:&nbsp;</li>
  687. <li>Field&nbsp;|&nbsp;</li>
  688. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  689. <li><a href="#method.detail">Method</a></li>
  690. </ul>
  691. </div>
  692. <a name="skip.navbar.bottom">
  693. <!-- -->
  694. </a></div>
  695. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  696. <p class="legalCopy"><small>Copyright &#169; 2018. All rights reserved.</small></p>
  697. </body>
  698. </html>