You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CodeIterator.html 69KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371
  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 (10.0.1) on Thu Jun 21 01:52:55 JST 2018 -->
  6. <title>CodeIterator (Javassist API)</title>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <meta name="date" content="2018-06-21">
  9. <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
  10. <link rel="stylesheet" type="text/css" href="../../jquery/jquery-ui.css" title="Style">
  11. <script type="text/javascript" src="../../script.js"></script>
  12. <script type="text/javascript" src="../../jquery/jszip/dist/jszip.min.js"></script>
  13. <script type="text/javascript" src="../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
  14. <!--[if IE]>
  15. <script type="text/javascript" src="../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
  16. <![endif]-->
  17. <script type="text/javascript" src="../../jquery/jquery-1.10.2.js"></script>
  18. <script type="text/javascript" src="../../jquery/jquery-ui.js"></script>
  19. </head>
  20. <body>
  21. <script type="text/javascript"><!--
  22. try {
  23. if (location.href.indexOf('is-external=true') == -1) {
  24. parent.document.title="CodeIterator (Javassist API)";
  25. }
  26. }
  27. catch(err) {
  28. }
  29. //-->
  30. var methods = {"i0":10,"i1":10,"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,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10};
  31. var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
  32. var altColor = "altColor";
  33. var rowColor = "rowColor";
  34. var tableTab = "tableTab";
  35. var activeTableTab = "activeTableTab";
  36. var pathtoroot = "../../";loadScripts(document, 'script');</script>
  37. <noscript>
  38. <div>JavaScript is disabled on your browser.</div>
  39. </noscript>
  40. <div class="fixedNav">
  41. <!-- ========= START OF TOP NAVBAR ======= -->
  42. <div class="topNav"><a name="navbar.top">
  43. <!-- -->
  44. </a>
  45. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  46. <a name="navbar.top.firstrow">
  47. <!-- -->
  48. </a>
  49. <ul class="navList" title="Navigation">
  50. <li><a href="../../overview-summary.html">Overview</a></li>
  51. <li><a href="package-summary.html">Package</a></li>
  52. <li class="navBarCell1Rev">Class</li>
  53. <li><a href="class-use/CodeIterator.html">Use</a></li>
  54. <li><a href="package-tree.html">Tree</a></li>
  55. <li><a href="../../deprecated-list.html">Deprecated</a></li>
  56. <li><a href="../../index-all.html">Index</a></li>
  57. </ul>
  58. </div>
  59. <div class="subNav">
  60. <ul class="navList">
  61. <li><a href="../../javassist/bytecode/CodeAttribute.RuntimeCopyException.html" title="class in javassist.bytecode"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  62. <li><a href="../../javassist/bytecode/CodeIterator.Gap.html" title="class in javassist.bytecode"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  63. </ul>
  64. <ul class="navList">
  65. <li><a href="../../index.html?javassist/bytecode/CodeIterator.html" target="_top">Frames</a></li>
  66. <li><a href="CodeIterator.html" target="_top">No&nbsp;Frames</a></li>
  67. </ul>
  68. <ul class="navList" id="allclasses_navbar_top">
  69. <li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  70. </ul>
  71. <ul class="navListSearch">
  72. <li><label for="search">SEARCH:</label>
  73. <input type="text" id="search" value="search" disabled="disabled">
  74. <input type="reset" id="reset" value="reset" disabled="disabled">
  75. </li>
  76. </ul>
  77. <div>
  78. <script type="text/javascript"><!--
  79. allClassesLink = document.getElementById("allclasses_navbar_top");
  80. if(window==top) {
  81. allClassesLink.style.display = "block";
  82. }
  83. else {
  84. allClassesLink.style.display = "none";
  85. }
  86. //-->
  87. </script>
  88. <noscript>
  89. <div>JavaScript is disabled on your browser.</div>
  90. </noscript>
  91. </div>
  92. <div>
  93. <ul class="subNavList">
  94. <li>Summary:&nbsp;</li>
  95. <li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
  96. <li>Field&nbsp;|&nbsp;</li>
  97. <li>Constr&nbsp;|&nbsp;</li>
  98. <li><a href="#method.summary">Method</a></li>
  99. </ul>
  100. <ul class="subNavList">
  101. <li>Detail:&nbsp;</li>
  102. <li>Field&nbsp;|&nbsp;</li>
  103. <li>Constr&nbsp;|&nbsp;</li>
  104. <li><a href="#method.detail">Method</a></li>
  105. </ul>
  106. </div>
  107. <a name="skip.navbar.top">
  108. <!-- -->
  109. </a></div>
  110. <!-- ========= END OF TOP NAVBAR ========= -->
  111. </div>
  112. <div class="navPadding">&nbsp;</div>
  113. <script type="text/javascript"><!--
  114. $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
  115. //-->
  116. </script>
  117. <!-- ======== START OF CLASS DATA ======== -->
  118. <div class="header">
  119. <div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="../../javassist/bytecode/package-summary.html">javassist.bytecode</a></div>
  120. <h2 title="Class CodeIterator" class="title">Class CodeIterator</h2>
  121. </div>
  122. <div class="contentContainer">
  123. <ul class="inheritance">
  124. <li>java.lang.Object</li>
  125. <li>
  126. <ul class="inheritance">
  127. <li>javassist.bytecode.CodeIterator</li>
  128. </ul>
  129. </li>
  130. </ul>
  131. <div class="description">
  132. <ul class="blockList">
  133. <li class="blockList">
  134. <dl>
  135. <dt>All Implemented Interfaces:</dt>
  136. <dd><code><a href="../../javassist/bytecode/Opcode.html" title="interface in javassist.bytecode">Opcode</a></code></dd>
  137. </dl>
  138. <hr>
  139. <pre>public class <span class="typeNameLabel">CodeIterator</span>
  140. extends java.lang.Object
  141. implements <a href="../../javassist/bytecode/Opcode.html" title="interface in javassist.bytecode">Opcode</a></pre>
  142. <div class="block">An iterator for editing a code attribute.
  143. <p>To directly read or edit a bytecode sequence, call <a href="../../javassist/bytecode/CodeIterator.html#byteAt-int-"><code>byteAt(int)</code></a>, <a href="../../javassist/bytecode/CodeIterator.html#s16bitAt-int-"><code>s16bitAt(int)</code></a>,
  144. <a href="../../javassist/bytecode/CodeIterator.html#writeByte-int-int-"><code>writeByte(int, int)</code></a>, <a href="../../javassist/bytecode/CodeIterator.html#write16bit-int-int-"><code>write16bit(int, int)</code></a>, and other methods.
  145. For example, if <code>method</code> refers to a <code>CtMethod</code> object,
  146. the following code substitutes the <code>NOP</code> instruction for the first
  147. instruction of the method:
  148. <pre>
  149. CodeAttribute ca = method.getMethodInfo().getCodeAttribute();
  150. CodeIterator ci = ca.iterator();
  151. ci.writeByte(Opcode.NOP, 0);</pre>
  152. <p>To visit every instruction, call <a href="../../javassist/bytecode/CodeIterator.html#next--"><code>next()</code></a> on a <code>CodeIterator</code>.
  153. It returns the index of the first byte of the next instruction.
  154. <p>If there are multiple <code>CodeIterator</code>s referring to the
  155. same <code>Code_attribute</code>, then inserting a gap by one
  156. <code>CodeIterator</code> will break the other
  157. <code>CodeIterator</code>.
  158. <p>This iterator does not provide <code>remove()</code>.
  159. If a piece of code in a <code>Code_attribute</code> is unnecessary,
  160. it should be overwritten with <code>NOP</code>.</div>
  161. <dl>
  162. <dt><span class="seeLabel">See Also:</span></dt>
  163. <dd><a href="../../javassist/bytecode/CodeAttribute.html#iterator--"><code>CodeAttribute.iterator()</code></a></dd>
  164. </dl>
  165. </li>
  166. </ul>
  167. </div>
  168. <div class="summary">
  169. <ul class="blockList">
  170. <li class="blockList">
  171. <!-- ======== NESTED CLASS SUMMARY ======== -->
  172. <ul class="blockList">
  173. <li class="blockList"><a name="nested.class.summary">
  174. <!-- -->
  175. </a>
  176. <h3>Nested Class Summary</h3>
  177. <table class="memberSummary" summary="Nested Class Summary table, listing nested classes, and an explanation">
  178. <caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
  179. <tr>
  180. <th class="colFirst" scope="col">Modifier and Type</th>
  181. <th class="colSecond" scope="col">Class</th>
  182. <th class="colLast" scope="col">Description</th>
  183. </tr>
  184. <tr class="altColor">
  185. <td class="colFirst"><code>static class&nbsp;</code></td>
  186. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.Gap.html" title="class in javassist.bytecode">CodeIterator.Gap</a></span></code></th>
  187. <td class="colLast">
  188. <div class="block">An inserted gap.</div>
  189. </td>
  190. </tr>
  191. </table>
  192. </li>
  193. </ul>
  194. <!-- =========== FIELD SUMMARY =========== -->
  195. <ul class="blockList">
  196. <li class="blockList"><a name="field.summary">
  197. <!-- -->
  198. </a>
  199. <h3>Field Summary</h3>
  200. <ul class="blockList">
  201. <li class="blockList"><a name="fields.inherited.from.class.javassist.bytecode.Opcode">
  202. <!-- -->
  203. </a>
  204. <h3>Fields inherited from interface&nbsp;javassist.bytecode.<a href="../../javassist/bytecode/Opcode.html" title="interface in javassist.bytecode">Opcode</a></h3>
  205. <code><a href="../../javassist/bytecode/Opcode.html#AALOAD">AALOAD</a>, <a href="../../javassist/bytecode/Opcode.html#AASTORE">AASTORE</a>, <a href="../../javassist/bytecode/Opcode.html#ACONST_NULL">ACONST_NULL</a>, <a href="../../javassist/bytecode/Opcode.html#ALOAD">ALOAD</a>, <a href="../../javassist/bytecode/Opcode.html#ALOAD_0">ALOAD_0</a>, <a href="../../javassist/bytecode/Opcode.html#ALOAD_1">ALOAD_1</a>, <a href="../../javassist/bytecode/Opcode.html#ALOAD_2">ALOAD_2</a>, <a href="../../javassist/bytecode/Opcode.html#ALOAD_3">ALOAD_3</a>, <a href="../../javassist/bytecode/Opcode.html#ANEWARRAY">ANEWARRAY</a>, <a href="../../javassist/bytecode/Opcode.html#ARETURN">ARETURN</a>, <a href="../../javassist/bytecode/Opcode.html#ARRAYLENGTH">ARRAYLENGTH</a>, <a href="../../javassist/bytecode/Opcode.html#ASTORE">ASTORE</a>, <a href="../../javassist/bytecode/Opcode.html#ASTORE_0">ASTORE_0</a>, <a href="../../javassist/bytecode/Opcode.html#ASTORE_1">ASTORE_1</a>, <a href="../../javassist/bytecode/Opcode.html#ASTORE_2">ASTORE_2</a>, <a href="../../javassist/bytecode/Opcode.html#ASTORE_3">ASTORE_3</a>, <a href="../../javassist/bytecode/Opcode.html#ATHROW">ATHROW</a>, <a href="../../javassist/bytecode/Opcode.html#BALOAD">BALOAD</a>, <a href="../../javassist/bytecode/Opcode.html#BASTORE">BASTORE</a>, <a href="../../javassist/bytecode/Opcode.html#BIPUSH">BIPUSH</a>, <a href="../../javassist/bytecode/Opcode.html#CALOAD">CALOAD</a>, <a href="../../javassist/bytecode/Opcode.html#CASTORE">CASTORE</a>, <a href="../../javassist/bytecode/Opcode.html#CHECKCAST">CHECKCAST</a>, <a href="../../javassist/bytecode/Opcode.html#D2F">D2F</a>, <a href="../../javassist/bytecode/Opcode.html#D2I">D2I</a>, <a href="../../javassist/bytecode/Opcode.html#D2L">D2L</a>, <a href="../../javassist/bytecode/Opcode.html#DADD">DADD</a>, <a href="../../javassist/bytecode/Opcode.html#DALOAD">DALOAD</a>, <a href="../../javassist/bytecode/Opcode.html#DASTORE">DASTORE</a>, <a href="../../javassist/bytecode/Opcode.html#DCMPG">DCMPG</a>, <a href="../../javassist/bytecode/Opcode.html#DCMPL">DCMPL</a>, <a href="../../javassist/bytecode/Opcode.html#DCONST_0">DCONST_0</a>, <a href="../../javassist/bytecode/Opcode.html#DCONST_1">DCONST_1</a>, <a href="../../javassist/bytecode/Opcode.html#DDIV">DDIV</a>, <a href="../../javassist/bytecode/Opcode.html#DLOAD">DLOAD</a>, <a href="../../javassist/bytecode/Opcode.html#DLOAD_0">DLOAD_0</a>, <a href="../../javassist/bytecode/Opcode.html#DLOAD_1">DLOAD_1</a>, <a href="../../javassist/bytecode/Opcode.html#DLOAD_2">DLOAD_2</a>, <a href="../../javassist/bytecode/Opcode.html#DLOAD_3">DLOAD_3</a>, <a href="../../javassist/bytecode/Opcode.html#DMUL">DMUL</a>, <a href="../../javassist/bytecode/Opcode.html#DNEG">DNEG</a>, <a href="../../javassist/bytecode/Opcode.html#DREM">DREM</a>, <a href="../../javassist/bytecode/Opcode.html#DRETURN">DRETURN</a>, <a href="../../javassist/bytecode/Opcode.html#DSTORE">DSTORE</a>, <a href="../../javassist/bytecode/Opcode.html#DSTORE_0">DSTORE_0</a>, <a href="../../javassist/bytecode/Opcode.html#DSTORE_1">DSTORE_1</a>, <a href="../../javassist/bytecode/Opcode.html#DSTORE_2">DSTORE_2</a>, <a href="../../javassist/bytecode/Opcode.html#DSTORE_3">DSTORE_3</a>, <a href="../../javassist/bytecode/Opcode.html#DSUB">DSUB</a>, <a href="../../javassist/bytecode/Opcode.html#DUP">DUP</a>, <a href="../../javassist/bytecode/Opcode.html#DUP_X1">DUP_X1</a>, <a href="../../javassist/bytecode/Opcode.html#DUP_X2">DUP_X2</a>, <a href="../../javassist/bytecode/Opcode.html#DUP2">DUP2</a>, <a href="../../javassist/bytecode/Opcode.html#DUP2_X1">DUP2_X1</a>, <a href="../../javassist/bytecode/Opcode.html#DUP2_X2">DUP2_X2</a>, <a href="../../javassist/bytecode/Opcode.html#F2D">F2D</a>, <a href="../../javassist/bytecode/Opcode.html#F2I">F2I</a>, <a href="../../javassist/bytecode/Opcode.html#F2L">F2L</a>, <a href="../../javassist/bytecode/Opcode.html#FADD">FADD</a>, <a href="../../javassist/bytecode/Opcode.html#FALOAD">FALOAD</a>, <a href="../../javassist/bytecode/Opcode.html#FASTORE">FASTORE</a>, <a href="../../javassist/bytecode/Opcode.html#FCMPG">FCMPG</a>, <a href="../../javassist/bytecode/Opcode.html#FCMPL">FCMPL</a>, <a href="../../javassist/bytecode/Opcode.html#FCONST_0">FCONST_0</a>, <a href="../../javassist/bytecode/Opcode.html#FCONST_1">FCONST_1</a>, <a href="../../javassist/bytecode/Opcode.html#FCONST_2">FCONST_2</a>, <a href="../../javassist/bytecode/Opcode.html#FDIV">FDIV</a>, <a href="../../javassist/bytecode/Opcode.html#FLOAD">FLOAD</a>, <a href="../../javassist/bytecode/Opcode.html#FLOAD_0">FLOAD_0</a>, <a href="../../javassist/bytecode/Opcode.html#FLOAD_1">FLOAD_1</a>, <a href="../../javassist/bytecode/Opcode.html#FLOAD_2">FLOAD_2</a>, <a href="../../javassist/bytecode/Opcode.html#FLOAD_3">FLOAD_3</a>, <a href="../../javassist/bytecode/Opcode.html#FMUL">FMUL</a>, <a href="../../javassist/bytecode/Opcode.html#FNEG">FNEG</a>, <a href="../../javassist/bytecode/Opcode.html#FREM">FREM</a>, <a href="../../javassist/bytecode/Opcode.html#FRETURN">FRETURN</a>, <a href="../../javassist/bytecode/Opcode.html#FSTORE">FSTORE</a>, <a href="../../javassist/bytecode/Opcode.html#FSTORE_0">FSTORE_0</a>, <a href="../../javassist/bytecode/Opcode.html#FSTORE_1">FSTORE_1</a>, <a href="../../javassist/bytecode/Opcode.html#FSTORE_2">FSTORE_2</a>, <a href="../../javassist/bytecode/Opcode.html#FSTORE_3">FSTORE_3</a>, <a href="../../javassist/bytecode/Opcode.html#FSUB">FSUB</a>, <a href="../../javassist/bytecode/Opcode.html#GETFIELD">GETFIELD</a>, <a href="../../javassist/bytecode/Opcode.html#GETSTATIC">GETSTATIC</a>, <a href="../../javassist/bytecode/Opcode.html#GOTO">GOTO</a>, <a href="../../javassist/bytecode/Opcode.html#GOTO_W">GOTO_W</a>, <a href="../../javassist/bytecode/Opcode.html#I2B">I2B</a>, <a href="../../javassist/bytecode/Opcode.html#I2C">I2C</a>, <a href="../../javassist/bytecode/Opcode.html#I2D">I2D</a>, <a href="../../javassist/bytecode/Opcode.html#I2F">I2F</a>, <a href="../../javassist/bytecode/Opcode.html#I2L">I2L</a>, <a href="../../javassist/bytecode/Opcode.html#I2S">I2S</a>, <a href="../../javassist/bytecode/Opcode.html#IADD">IADD</a>, <a href="../../javassist/bytecode/Opcode.html#IALOAD">IALOAD</a>, <a href="../../javassist/bytecode/Opcode.html#IAND">IAND</a>, <a href="../../javassist/bytecode/Opcode.html#IASTORE">IASTORE</a>, <a href="../../javassist/bytecode/Opcode.html#ICONST_0">ICONST_0</a>, <a href="../../javassist/bytecode/Opcode.html#ICONST_1">ICONST_1</a>, <a href="../../javassist/bytecode/Opcode.html#ICONST_2">ICONST_2</a>, <a href="../../javassist/bytecode/Opcode.html#ICONST_3">ICONST_3</a>, <a href="../../javassist/bytecode/Opcode.html#ICONST_4">ICONST_4</a>, <a href="../../javassist/bytecode/Opcode.html#ICONST_5">ICONST_5</a>, <a href="../../javassist/bytecode/Opcode.html#ICONST_M1">ICONST_M1</a>, <a href="../../javassist/bytecode/Opcode.html#IDIV">IDIV</a>, <a href="../../javassist/bytecode/Opcode.html#IF_ACMPEQ">IF_ACMPEQ</a>, <a href="../../javassist/bytecode/Opcode.html#IF_ACMPNE">IF_ACMPNE</a>, <a href="../../javassist/bytecode/Opcode.html#IF_ICMPEQ">IF_ICMPEQ</a>, <a href="../../javassist/bytecode/Opcode.html#IF_ICMPGE">IF_ICMPGE</a>, <a href="../../javassist/bytecode/Opcode.html#IF_ICMPGT">IF_ICMPGT</a>, <a href="../../javassist/bytecode/Opcode.html#IF_ICMPLE">IF_ICMPLE</a>, <a href="../../javassist/bytecode/Opcode.html#IF_ICMPLT">IF_ICMPLT</a>, <a href="../../javassist/bytecode/Opcode.html#IF_ICMPNE">IF_ICMPNE</a>, <a href="../../javassist/bytecode/Opcode.html#IFEQ">IFEQ</a>, <a href="../../javassist/bytecode/Opcode.html#IFGE">IFGE</a>, <a href="../../javassist/bytecode/Opcode.html#IFGT">IFGT</a>, <a href="../../javassist/bytecode/Opcode.html#IFLE">IFLE</a>, <a href="../../javassist/bytecode/Opcode.html#IFLT">IFLT</a>, <a href="../../javassist/bytecode/Opcode.html#IFNE">IFNE</a>, <a href="../../javassist/bytecode/Opcode.html#IFNONNULL">IFNONNULL</a>, <a href="../../javassist/bytecode/Opcode.html#IFNULL">IFNULL</a>, <a href="../../javassist/bytecode/Opcode.html#IINC">IINC</a>, <a href="../../javassist/bytecode/Opcode.html#ILOAD">ILOAD</a>, <a href="../../javassist/bytecode/Opcode.html#ILOAD_0">ILOAD_0</a>, <a href="../../javassist/bytecode/Opcode.html#ILOAD_1">ILOAD_1</a>, <a href="../../javassist/bytecode/Opcode.html#ILOAD_2">ILOAD_2</a>, <a href="../../javassist/bytecode/Opcode.html#ILOAD_3">ILOAD_3</a>, <a href="../../javassist/bytecode/Opcode.html#IMUL">IMUL</a>, <a href="../../javassist/bytecode/Opcode.html#INEG">INEG</a>, <a href="../../javassist/bytecode/Opcode.html#INSTANCEOF">INSTANCEOF</a>, <a href="../../javassist/bytecode/Opcode.html#INVOKEDYNAMIC">INVOKEDYNAMIC</a>, <a href="../../javassist/bytecode/Opcode.html#INVOKEINTERFACE">INVOKEINTERFACE</a>, <a href="../../javassist/bytecode/Opcode.html#INVOKESPECIAL">INVOKESPECIAL</a>, <a href="../../javassist/bytecode/Opcode.html#INVOKESTATIC">INVOKESTATIC</a>, <a href="../../javassist/bytecode/Opcode.html#INVOKEVIRTUAL">INVOKEVIRTUAL</a>, <a href="../../javassist/bytecode/Opcode.html#IOR">IOR</a>, <a href="../../javassist/bytecode/Opcode.html#IREM">IREM</a>, <a href="../../javassist/bytecode/Opcode.html#IRETURN">IRETURN</a>, <a href="../../javassist/bytecode/Opcode.html#ISHL">ISHL</a>, <a href="../../javassist/bytecode/Opcode.html#ISHR">ISHR</a>, <a href="../../javassist/bytecode/Opcode.html#ISTORE">ISTORE</a>, <a href="../../javassist/bytecode/Opcode.html#ISTORE_0">ISTORE_0</a>, <a href="../../javassist/bytecode/Opcode.html#ISTORE_1">ISTORE_1</a>, <a href="../../javassist/bytecode/Opcode.html#ISTORE_2">ISTORE_2</a>, <a href="../../javassist/bytecode/Opcode.html#ISTORE_3">ISTORE_3</a>, <a href="../../javassist/bytecode/Opcode.html#ISUB">ISUB</a>, <a href="../../javassist/bytecode/Opcode.html#IUSHR">IUSHR</a>, <a href="../../javassist/bytecode/Opcode.html#IXOR">IXOR</a>, <a href="../../javassist/bytecode/Opcode.html#JSR">JSR</a>, <a href="../../javassist/bytecode/Opcode.html#JSR_W">JSR_W</a>, <a href="../../javassist/bytecode/Opcode.html#L2D">L2D</a>, <a href="../../javassist/bytecode/Opcode.html#L2F">L2F</a>, <a href="../../javassist/bytecode/Opcode.html#L2I">L2I</a>, <a href="../../javassist/bytecode/Opcode.html#LADD">LADD</a>, <a href="../../javassist/bytecode/Opcode.html#LALOAD">LALOAD</a>, <a href="../../javassist/bytecode/Opcode.html#LAND">LAND</a>, <a href="../../javassist/bytecode/Opcode.html#LASTORE">LASTORE</a>, <a href="../../javassist/bytecode/Opcode.html#LCMP">LCMP</a>, <a href="../../javassist/bytecode/Opcode.html#LCONST_0">LCONST_0</a>, <a href="../../javassist/bytecode/Opcode.html#LCONST_1">LCONST_1</a>, <a href="../../javassist/bytecode/Opcode.html#LDC">LDC</a>, <a href="../../javassist/bytecode/Opcode.html#LDC_W">LDC_W</a>, <a href="../../javassist/bytecode/Opcode.html#LDC2_W">LDC2_W</a>, <a href="../../javassist/bytecode/Opcode.html#LDIV">LDIV</a>, <a href="../../javassist/bytecode/Opcode.html#LLOAD">LLOAD</a>, <a href="../../javassist/bytecode/Opcode.html#LLOAD_0">LLOAD_0</a>, <a href="../../javassist/bytecode/Opcode.html#LLOAD_1">LLOAD_1</a>, <a href="../../javassist/bytecode/Opcode.html#LLOAD_2">LLOAD_2</a>, <a href="../../javassist/bytecode/Opcode.html#LLOAD_3">LLOAD_3</a>, <a href="../../javassist/bytecode/Opcode.html#LMUL">LMUL</a>, <a href="../../javassist/bytecode/Opcode.html#LNEG">LNEG</a>, <a href="../../javassist/bytecode/Opcode.html#LOOKUPSWITCH">LOOKUPSWITCH</a>, <a href="../../javassist/bytecode/Opcode.html#LOR">LOR</a>, <a href="../../javassist/bytecode/Opcode.html#LREM">LREM</a>, <a href="../../javassist/bytecode/Opcode.html#LRETURN">LRETURN</a>, <a href="../../javassist/bytecode/Opcode.html#LSHL">LSHL</a>, <a href="../../javassist/bytecode/Opcode.html#LSHR">LSHR</a>, <a href="../../javassist/bytecode/Opcode.html#LSTORE">LSTORE</a>, <a href="../../javassist/bytecode/Opcode.html#LSTORE_0">LSTORE_0</a>, <a href="../../javassist/bytecode/Opcode.html#LSTORE_1">LSTORE_1</a>, <a href="../../javassist/bytecode/Opcode.html#LSTORE_2">LSTORE_2</a>, <a href="../../javassist/bytecode/Opcode.html#LSTORE_3">LSTORE_3</a>, <a href="../../javassist/bytecode/Opcode.html#LSUB">LSUB</a>, <a href="../../javassist/bytecode/Opcode.html#LUSHR">LUSHR</a>, <a href="../../javassist/bytecode/Opcode.html#LXOR">LXOR</a>, <a href="../../javassist/bytecode/Opcode.html#MONITORENTER">MONITORENTER</a>, <a href="../../javassist/bytecode/Opcode.html#MONITOREXIT">MONITOREXIT</a>, <a href="../../javassist/bytecode/Opcode.html#MULTIANEWARRAY">MULTIANEWARRAY</a>, <a href="../../javassist/bytecode/Opcode.html#NEW">NEW</a>, <a href="../../javassist/bytecode/Opcode.html#NEWARRAY">NEWARRAY</a>, <a href="../../javassist/bytecode/Opcode.html#NOP">NOP</a>, <a href="../../javassist/bytecode/Opcode.html#POP">POP</a>, <a href="../../javassist/bytecode/Opcode.html#POP2">POP2</a>, <a href="../../javassist/bytecode/Opcode.html#PUTFIELD">PUTFIELD</a>, <a href="../../javassist/bytecode/Opcode.html#PUTSTATIC">PUTSTATIC</a>, <a href="../../javassist/bytecode/Opcode.html#RET">RET</a>, <a href="../../javassist/bytecode/Opcode.html#RETURN">RETURN</a>, <a href="../../javassist/bytecode/Opcode.html#SALOAD">SALOAD</a>, <a href="../../javassist/bytecode/Opcode.html#SASTORE">SASTORE</a>, <a href="../../javassist/bytecode/Opcode.html#SIPUSH">SIPUSH</a>, <a href="../../javassist/bytecode/Opcode.html#STACK_GROW">STACK_GROW</a>, <a href="../../javassist/bytecode/Opcode.html#SWAP">SWAP</a>, <a href="../../javassist/bytecode/Opcode.html#T_BOOLEAN">T_BOOLEAN</a>, <a href="../../javassist/bytecode/Opcode.html#T_BYTE">T_BYTE</a>, <a href="../../javassist/bytecode/Opcode.html#T_CHAR">T_CHAR</a>, <a href="../../javassist/bytecode/Opcode.html#T_DOUBLE">T_DOUBLE</a>, <a href="../../javassist/bytecode/Opcode.html#T_FLOAT">T_FLOAT</a>, <a href="../../javassist/bytecode/Opcode.html#T_INT">T_INT</a>, <a href="../../javassist/bytecode/Opcode.html#T_LONG">T_LONG</a>, <a href="../../javassist/bytecode/Opcode.html#T_SHORT">T_SHORT</a>, <a href="../../javassist/bytecode/Opcode.html#TABLESWITCH">TABLESWITCH</a>, <a href="../../javassist/bytecode/Opcode.html#WIDE">WIDE</a></code></li>
  206. </ul>
  207. </li>
  208. </ul>
  209. <!-- ========== METHOD SUMMARY =========== -->
  210. <ul class="blockList">
  211. <li class="blockList"><a name="method.summary">
  212. <!-- -->
  213. </a>
  214. <h3>Method Summary</h3>
  215. <table class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
  216. <caption><span id="t0" class="activeTableTab"><span>All Methods</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>
  217. <tr>
  218. <th class="colFirst" scope="col">Modifier and Type</th>
  219. <th class="colSecond" scope="col">Method</th>
  220. <th class="colLast" scope="col">Description</th>
  221. </tr>
  222. <tr id="i0" class="altColor">
  223. <td class="colFirst"><code>int</code></td>
  224. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#append-byte:A-">append</a></span>&#8203;(byte[]&nbsp;code)</code></th>
  225. <td class="colLast">
  226. <div class="block">Appends the given bytecode sequence at the end.</div>
  227. </td>
  228. </tr>
  229. <tr id="i1" class="rowColor">
  230. <td class="colFirst"><code>void</code></td>
  231. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#append-javassist.bytecode.ExceptionTable-int-">append</a></span>&#8203;(<a href="../../javassist/bytecode/ExceptionTable.html" title="class in javassist.bytecode">ExceptionTable</a>&nbsp;et,
  232. int&nbsp;offset)</code></th>
  233. <td class="colLast">
  234. <div class="block">Copies and appends the entries in the given exception table
  235. at the end of the exception table in the code attribute
  236. edited by this object.</div>
  237. </td>
  238. </tr>
  239. <tr id="i2" class="altColor">
  240. <td class="colFirst"><code>void</code></td>
  241. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#appendGap-int-">appendGap</a></span>&#8203;(int&nbsp;gapLength)</code></th>
  242. <td class="colLast">
  243. <div class="block">Appends a gap at the end of the bytecode sequence.</div>
  244. </td>
  245. </tr>
  246. <tr id="i3" class="rowColor">
  247. <td class="colFirst"><code>void</code></td>
  248. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#begin--">begin</a></span>()</code></th>
  249. <td class="colLast">
  250. <div class="block">Moves to the first instruction.</div>
  251. </td>
  252. </tr>
  253. <tr id="i4" class="altColor">
  254. <td class="colFirst"><code>int</code></td>
  255. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#byteAt-int-">byteAt</a></span>&#8203;(int&nbsp;index)</code></th>
  256. <td class="colLast">
  257. <div class="block">Returns the unsigned 8bit value at the given index.</div>
  258. </td>
  259. </tr>
  260. <tr id="i5" class="rowColor">
  261. <td class="colFirst"><code><a href="../../javassist/bytecode/CodeAttribute.html" title="class in javassist.bytecode">CodeAttribute</a></code></td>
  262. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#get--">get</a></span>()</code></th>
  263. <td class="colLast">
  264. <div class="block">Returns a Code attribute read with this iterator.</div>
  265. </td>
  266. </tr>
  267. <tr id="i6" class="altColor">
  268. <td class="colFirst"><code>int</code></td>
  269. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#getCodeLength--">getCodeLength</a></span>()</code></th>
  270. <td class="colLast">
  271. <div class="block">Returns <code>code_length</code> of <code>Code_attribute</code>.</div>
  272. </td>
  273. </tr>
  274. <tr id="i7" class="rowColor">
  275. <td class="colFirst"><code>int</code></td>
  276. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#getMark--">getMark</a></span>()</code></th>
  277. <td class="colLast">
  278. <div class="block">Gets the index of the position of the mark set by
  279. <code>setMark</code>.</div>
  280. </td>
  281. </tr>
  282. <tr id="i8" class="altColor">
  283. <td class="colFirst"><code>boolean</code></td>
  284. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#hasNext--">hasNext</a></span>()</code></th>
  285. <td class="colLast">
  286. <div class="block">Returns true if there is more instructions.</div>
  287. </td>
  288. </tr>
  289. <tr id="i9" class="rowColor">
  290. <td class="colFirst"><code>int</code></td>
  291. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#insert-byte:A-">insert</a></span>&#8203;(byte[]&nbsp;code)</code></th>
  292. <td class="colLast">
  293. <div class="block">Inserts the given bytecode sequence
  294. before the next instruction that would be returned by
  295. <code>next()</code> (not before the instruction returned
  296. by the last call to <code>next()</code>).</div>
  297. </td>
  298. </tr>
  299. <tr id="i10" class="altColor">
  300. <td class="colFirst"><code>void</code></td>
  301. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#insert-int-byte:A-">insert</a></span>&#8203;(int&nbsp;pos,
  302. byte[]&nbsp;code)</code></th>
  303. <td class="colLast">
  304. <div class="block">Inserts the given bytecode sequence
  305. before the instruction at the given index <code>pos</code>.</div>
  306. </td>
  307. </tr>
  308. <tr id="i11" class="rowColor">
  309. <td class="colFirst"><code>void</code></td>
  310. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#insert-javassist.bytecode.ExceptionTable-int-">insert</a></span>&#8203;(<a href="../../javassist/bytecode/ExceptionTable.html" title="class in javassist.bytecode">ExceptionTable</a>&nbsp;et,
  311. int&nbsp;offset)</code></th>
  312. <td class="colLast">
  313. <div class="block">Copies and inserts the entries in the given exception table
  314. at the beginning of the exception table in the code attribute
  315. edited by this object.</div>
  316. </td>
  317. </tr>
  318. <tr id="i12" class="altColor">
  319. <td class="colFirst"><code>int</code></td>
  320. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#insertAt-int-byte:A-">insertAt</a></span>&#8203;(int&nbsp;pos,
  321. byte[]&nbsp;code)</code></th>
  322. <td class="colLast">
  323. <div class="block">Inserts the given bytecode sequence
  324. before the instruction at the given index <code>pos</code>.</div>
  325. </td>
  326. </tr>
  327. <tr id="i13" class="rowColor">
  328. <td class="colFirst"><code>int</code></td>
  329. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#insertEx-byte:A-">insertEx</a></span>&#8203;(byte[]&nbsp;code)</code></th>
  330. <td class="colLast">
  331. <div class="block">Inserts the given bytecode sequence exclusively
  332. before the next instruction that would be returned by
  333. <code>next()</code> (not before the instruction returned
  334. by tha last call to <code>next()</code>).</div>
  335. </td>
  336. </tr>
  337. <tr id="i14" class="altColor">
  338. <td class="colFirst"><code>void</code></td>
  339. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#insertEx-int-byte:A-">insertEx</a></span>&#8203;(int&nbsp;pos,
  340. byte[]&nbsp;code)</code></th>
  341. <td class="colLast">
  342. <div class="block">Inserts the given bytecode sequence exclusively
  343. before the instruction at the given index <code>pos</code>.</div>
  344. </td>
  345. </tr>
  346. <tr id="i15" class="rowColor">
  347. <td class="colFirst"><code>int</code></td>
  348. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#insertExAt-int-byte:A-">insertExAt</a></span>&#8203;(int&nbsp;pos,
  349. byte[]&nbsp;code)</code></th>
  350. <td class="colLast">
  351. <div class="block">Inserts the given bytecode sequence exclusively
  352. before the instruction at the given index <code>pos</code>.</div>
  353. </td>
  354. </tr>
  355. <tr id="i16" class="altColor">
  356. <td class="colFirst"><code>int</code></td>
  357. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#insertExGap-int-">insertExGap</a></span>&#8203;(int&nbsp;length)</code></th>
  358. <td class="colLast">
  359. <div class="block">Inserts an exclusive gap
  360. before the next instruction that would be returned by
  361. <code>next()</code> (not before the instruction returned
  362. by the last call to <code>next()</code>).</div>
  363. </td>
  364. </tr>
  365. <tr id="i17" class="rowColor">
  366. <td class="colFirst"><code>int</code></td>
  367. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#insertExGap-int-int-">insertExGap</a></span>&#8203;(int&nbsp;pos,
  368. int&nbsp;length)</code></th>
  369. <td class="colLast">
  370. <div class="block">Inserts an exclusive gap in front of the instruction at the given
  371. index <code>pos</code>.</div>
  372. </td>
  373. </tr>
  374. <tr id="i18" class="altColor">
  375. <td class="colFirst"><code>int</code></td>
  376. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#insertGap-int-">insertGap</a></span>&#8203;(int&nbsp;length)</code></th>
  377. <td class="colLast">
  378. <div class="block">Inserts a gap
  379. before the next instruction that would be returned by
  380. <code>next()</code> (not before the instruction returned
  381. by the last call to <code>next()</code>).</div>
  382. </td>
  383. </tr>
  384. <tr id="i19" class="rowColor">
  385. <td class="colFirst"><code>int</code></td>
  386. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#insertGap-int-int-">insertGap</a></span>&#8203;(int&nbsp;pos,
  387. int&nbsp;length)</code></th>
  388. <td class="colLast">
  389. <div class="block">Inserts a gap in front of the instruction at the given
  390. index <code>pos</code>.</div>
  391. </td>
  392. </tr>
  393. <tr id="i20" class="altColor">
  394. <td class="colFirst"><code><a href="../../javassist/bytecode/CodeIterator.Gap.html" title="class in javassist.bytecode">CodeIterator.Gap</a></code></td>
  395. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#insertGapAt-int-int-boolean-">insertGapAt</a></span>&#8203;(int&nbsp;pos,
  396. int&nbsp;length,
  397. boolean&nbsp;exclusive)</code></th>
  398. <td class="colLast">
  399. <div class="block">Inserts an inclusive or exclusive gap in front of the instruction
  400. at the given index <code>pos</code>.</div>
  401. </td>
  402. </tr>
  403. <tr id="i21" class="rowColor">
  404. <td class="colFirst"><code>int</code></td>
  405. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#lookAhead--">lookAhead</a></span>()</code></th>
  406. <td class="colLast">
  407. <div class="block">Obtains the value that the next call
  408. to <code>next()</code> will return.</div>
  409. </td>
  410. </tr>
  411. <tr id="i22" class="altColor">
  412. <td class="colFirst"><code>void</code></td>
  413. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#move-int-">move</a></span>&#8203;(int&nbsp;index)</code></th>
  414. <td class="colLast">
  415. <div class="block">Moves to the given index.</div>
  416. </td>
  417. </tr>
  418. <tr id="i23" class="rowColor">
  419. <td class="colFirst"><code>int</code></td>
  420. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#next--">next</a></span>()</code></th>
  421. <td class="colLast">
  422. <div class="block">Returns the index of the next instruction
  423. (not the operand following the current opcode).</div>
  424. </td>
  425. </tr>
  426. <tr id="i24" class="altColor">
  427. <td class="colFirst"><code>int</code></td>
  428. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#s16bitAt-int-">s16bitAt</a></span>&#8203;(int&nbsp;index)</code></th>
  429. <td class="colLast">
  430. <div class="block">Returns the signed 16bit value at the given index.</div>
  431. </td>
  432. </tr>
  433. <tr id="i25" class="rowColor">
  434. <td class="colFirst"><code>int</code></td>
  435. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#s32bitAt-int-">s32bitAt</a></span>&#8203;(int&nbsp;index)</code></th>
  436. <td class="colLast">
  437. <div class="block">Returns the signed 32bit value at the given index.</div>
  438. </td>
  439. </tr>
  440. <tr id="i26" class="altColor">
  441. <td class="colFirst"><code>void</code></td>
  442. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#setMark-int-">setMark</a></span>&#8203;(int&nbsp;index)</code></th>
  443. <td class="colLast">
  444. <div class="block">Sets a mark to the bytecode at the given index.</div>
  445. </td>
  446. </tr>
  447. <tr id="i27" class="rowColor">
  448. <td class="colFirst"><code>int</code></td>
  449. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#signedByteAt-int-">signedByteAt</a></span>&#8203;(int&nbsp;index)</code></th>
  450. <td class="colLast">
  451. <div class="block">Returns the signed 8bit value at the given index.</div>
  452. </td>
  453. </tr>
  454. <tr id="i28" class="altColor">
  455. <td class="colFirst"><code>int</code></td>
  456. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#skipConstructor--">skipConstructor</a></span>()</code></th>
  457. <td class="colLast">
  458. <div class="block">Moves to the instruction for
  459. either <code>super()</code> or <code>this()</code>.</div>
  460. </td>
  461. </tr>
  462. <tr id="i29" class="rowColor">
  463. <td class="colFirst"><code>int</code></td>
  464. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#skipSuperConstructor--">skipSuperConstructor</a></span>()</code></th>
  465. <td class="colLast">
  466. <div class="block">Moves to the instruction for <code>super()</code>.</div>
  467. </td>
  468. </tr>
  469. <tr id="i30" class="altColor">
  470. <td class="colFirst"><code>int</code></td>
  471. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#skipThisConstructor--">skipThisConstructor</a></span>()</code></th>
  472. <td class="colLast">
  473. <div class="block">Moves to the instruction for <code>this()</code>.</div>
  474. </td>
  475. </tr>
  476. <tr id="i31" class="rowColor">
  477. <td class="colFirst"><code>int</code></td>
  478. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#u16bitAt-int-">u16bitAt</a></span>&#8203;(int&nbsp;index)</code></th>
  479. <td class="colLast">
  480. <div class="block">Returns the unsigned 16bit value at the given index.</div>
  481. </td>
  482. </tr>
  483. <tr id="i32" class="altColor">
  484. <td class="colFirst"><code>void</code></td>
  485. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#write-byte:A-int-">write</a></span>&#8203;(byte[]&nbsp;code,
  486. int&nbsp;index)</code></th>
  487. <td class="colLast">
  488. <div class="block">Writes a byte array at the index.</div>
  489. </td>
  490. </tr>
  491. <tr id="i33" class="rowColor">
  492. <td class="colFirst"><code>void</code></td>
  493. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#write16bit-int-int-">write16bit</a></span>&#8203;(int&nbsp;value,
  494. int&nbsp;index)</code></th>
  495. <td class="colLast">
  496. <div class="block">Writes a 16 bit integer at the index.</div>
  497. </td>
  498. </tr>
  499. <tr id="i34" class="altColor">
  500. <td class="colFirst"><code>void</code></td>
  501. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#write32bit-int-int-">write32bit</a></span>&#8203;(int&nbsp;value,
  502. int&nbsp;index)</code></th>
  503. <td class="colLast">
  504. <div class="block">Writes a 32bit integer at the index.</div>
  505. </td>
  506. </tr>
  507. <tr id="i35" class="rowColor">
  508. <td class="colFirst"><code>void</code></td>
  509. <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javassist/bytecode/CodeIterator.html#writeByte-int-int-">writeByte</a></span>&#8203;(int&nbsp;value,
  510. int&nbsp;index)</code></th>
  511. <td class="colLast">
  512. <div class="block">Writes an 8bit value at the given index.</div>
  513. </td>
  514. </tr>
  515. </table>
  516. <ul class="blockList">
  517. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  518. <!-- -->
  519. </a>
  520. <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
  521. <code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
  522. </ul>
  523. </li>
  524. </ul>
  525. </li>
  526. </ul>
  527. </div>
  528. <div class="details">
  529. <ul class="blockList">
  530. <li class="blockList">
  531. <!-- ============ METHOD DETAIL ========== -->
  532. <ul class="blockList">
  533. <li class="blockList"><a name="method.detail">
  534. <!-- -->
  535. </a>
  536. <h3>Method Detail</h3>
  537. <a name="begin--">
  538. <!-- -->
  539. </a>
  540. <ul class="blockList">
  541. <li class="blockList">
  542. <h4>begin</h4>
  543. <pre>public&nbsp;void&nbsp;begin()</pre>
  544. <div class="block">Moves to the first instruction.</div>
  545. </li>
  546. </ul>
  547. <a name="move-int-">
  548. <!-- -->
  549. </a>
  550. <ul class="blockList">
  551. <li class="blockList">
  552. <h4>move</h4>
  553. <pre>public&nbsp;void&nbsp;move&#8203;(int&nbsp;index)</pre>
  554. <div class="block">Moves to the given index.
  555. <p>The index of the next instruction is set to the given index.
  556. The successive call to <code>next()</code>
  557. returns the index that has been given to <code>move()</code>.
  558. <p>Note that the index is into the byte array returned by
  559. <code>get().getCode()</code>.</div>
  560. <dl>
  561. <dt><span class="seeLabel">See Also:</span></dt>
  562. <dd><a href="../../javassist/bytecode/CodeAttribute.html#getCode--"><code>CodeAttribute.getCode()</code></a></dd>
  563. </dl>
  564. </li>
  565. </ul>
  566. <a name="setMark-int-">
  567. <!-- -->
  568. </a>
  569. <ul class="blockList">
  570. <li class="blockList">
  571. <h4>setMark</h4>
  572. <pre>public&nbsp;void&nbsp;setMark&#8203;(int&nbsp;index)</pre>
  573. <div class="block">Sets a mark to the bytecode at the given index.
  574. The mark can be used to track the position of that bytecode
  575. when code blocks are inserted.
  576. If a code block is inclusively inserted at the position of the
  577. bytecode, the mark is set to the inserted code block.</div>
  578. <dl>
  579. <dt><span class="simpleTagLabel">Since:</span></dt>
  580. <dd>3.11</dd>
  581. <dt><span class="seeLabel">See Also:</span></dt>
  582. <dd><a href="../../javassist/bytecode/CodeIterator.html#getMark--"><code>getMark()</code></a></dd>
  583. </dl>
  584. </li>
  585. </ul>
  586. <a name="getMark--">
  587. <!-- -->
  588. </a>
  589. <ul class="blockList">
  590. <li class="blockList">
  591. <h4>getMark</h4>
  592. <pre>public&nbsp;int&nbsp;getMark()</pre>
  593. <div class="block">Gets the index of the position of the mark set by
  594. <code>setMark</code>.</div>
  595. <dl>
  596. <dt><span class="returnLabel">Returns:</span></dt>
  597. <dd>the index of the position.</dd>
  598. <dt><span class="simpleTagLabel">Since:</span></dt>
  599. <dd>3.11</dd>
  600. <dt><span class="seeLabel">See Also:</span></dt>
  601. <dd><a href="../../javassist/bytecode/CodeIterator.html#setMark-int-"><code>setMark(int)</code></a></dd>
  602. </dl>
  603. </li>
  604. </ul>
  605. <a name="get--">
  606. <!-- -->
  607. </a>
  608. <ul class="blockList">
  609. <li class="blockList">
  610. <h4>get</h4>
  611. <pre>public&nbsp;<a href="../../javassist/bytecode/CodeAttribute.html" title="class in javassist.bytecode">CodeAttribute</a>&nbsp;get()</pre>
  612. <div class="block">Returns a Code attribute read with this iterator.</div>
  613. </li>
  614. </ul>
  615. <a name="getCodeLength--">
  616. <!-- -->
  617. </a>
  618. <ul class="blockList">
  619. <li class="blockList">
  620. <h4>getCodeLength</h4>
  621. <pre>public&nbsp;int&nbsp;getCodeLength()</pre>
  622. <div class="block">Returns <code>code_length</code> of <code>Code_attribute</code>.</div>
  623. </li>
  624. </ul>
  625. <a name="byteAt-int-">
  626. <!-- -->
  627. </a>
  628. <ul class="blockList">
  629. <li class="blockList">
  630. <h4>byteAt</h4>
  631. <pre>public&nbsp;int&nbsp;byteAt&#8203;(int&nbsp;index)</pre>
  632. <div class="block">Returns the unsigned 8bit value at the given index.</div>
  633. </li>
  634. </ul>
  635. <a name="signedByteAt-int-">
  636. <!-- -->
  637. </a>
  638. <ul class="blockList">
  639. <li class="blockList">
  640. <h4>signedByteAt</h4>
  641. <pre>public&nbsp;int&nbsp;signedByteAt&#8203;(int&nbsp;index)</pre>
  642. <div class="block">Returns the signed 8bit value at the given index.</div>
  643. </li>
  644. </ul>
  645. <a name="writeByte-int-int-">
  646. <!-- -->
  647. </a>
  648. <ul class="blockList">
  649. <li class="blockList">
  650. <h4>writeByte</h4>
  651. <pre>public&nbsp;void&nbsp;writeByte&#8203;(int&nbsp;value,
  652. int&nbsp;index)</pre>
  653. <div class="block">Writes an 8bit value at the given index.</div>
  654. </li>
  655. </ul>
  656. <a name="u16bitAt-int-">
  657. <!-- -->
  658. </a>
  659. <ul class="blockList">
  660. <li class="blockList">
  661. <h4>u16bitAt</h4>
  662. <pre>public&nbsp;int&nbsp;u16bitAt&#8203;(int&nbsp;index)</pre>
  663. <div class="block">Returns the unsigned 16bit value at the given index.</div>
  664. </li>
  665. </ul>
  666. <a name="s16bitAt-int-">
  667. <!-- -->
  668. </a>
  669. <ul class="blockList">
  670. <li class="blockList">
  671. <h4>s16bitAt</h4>
  672. <pre>public&nbsp;int&nbsp;s16bitAt&#8203;(int&nbsp;index)</pre>
  673. <div class="block">Returns the signed 16bit value at the given index.</div>
  674. </li>
  675. </ul>
  676. <a name="write16bit-int-int-">
  677. <!-- -->
  678. </a>
  679. <ul class="blockList">
  680. <li class="blockList">
  681. <h4>write16bit</h4>
  682. <pre>public&nbsp;void&nbsp;write16bit&#8203;(int&nbsp;value,
  683. int&nbsp;index)</pre>
  684. <div class="block">Writes a 16 bit integer at the index.</div>
  685. </li>
  686. </ul>
  687. <a name="s32bitAt-int-">
  688. <!-- -->
  689. </a>
  690. <ul class="blockList">
  691. <li class="blockList">
  692. <h4>s32bitAt</h4>
  693. <pre>public&nbsp;int&nbsp;s32bitAt&#8203;(int&nbsp;index)</pre>
  694. <div class="block">Returns the signed 32bit value at the given index.</div>
  695. </li>
  696. </ul>
  697. <a name="write32bit-int-int-">
  698. <!-- -->
  699. </a>
  700. <ul class="blockList">
  701. <li class="blockList">
  702. <h4>write32bit</h4>
  703. <pre>public&nbsp;void&nbsp;write32bit&#8203;(int&nbsp;value,
  704. int&nbsp;index)</pre>
  705. <div class="block">Writes a 32bit integer at the index.</div>
  706. </li>
  707. </ul>
  708. <a name="write-byte:A-int-">
  709. <!-- -->
  710. </a>
  711. <ul class="blockList">
  712. <li class="blockList">
  713. <h4>write</h4>
  714. <pre>public&nbsp;void&nbsp;write&#8203;(byte[]&nbsp;code,
  715. int&nbsp;index)</pre>
  716. <div class="block">Writes a byte array at the index.</div>
  717. <dl>
  718. <dt><span class="paramLabel">Parameters:</span></dt>
  719. <dd><code>code</code> - may be a zero-length array.</dd>
  720. </dl>
  721. </li>
  722. </ul>
  723. <a name="hasNext--">
  724. <!-- -->
  725. </a>
  726. <ul class="blockList">
  727. <li class="blockList">
  728. <h4>hasNext</h4>
  729. <pre>public&nbsp;boolean&nbsp;hasNext()</pre>
  730. <div class="block">Returns true if there is more instructions.</div>
  731. </li>
  732. </ul>
  733. <a name="next--">
  734. <!-- -->
  735. </a>
  736. <ul class="blockList">
  737. <li class="blockList">
  738. <h4>next</h4>
  739. <pre>public&nbsp;int&nbsp;next()
  740. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  741. <div class="block">Returns the index of the next instruction
  742. (not the operand following the current opcode).
  743. <p>Note that the index is into the byte array returned by
  744. <code>get().getCode()</code>.</div>
  745. <dl>
  746. <dt><span class="throwsLabel">Throws:</span></dt>
  747. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  748. <dt><span class="seeLabel">See Also:</span></dt>
  749. <dd><a href="../../javassist/bytecode/CodeAttribute.html#getCode--"><code>CodeAttribute.getCode()</code></a>,
  750. <a href="../../javassist/bytecode/CodeIterator.html#byteAt-int-"><code>byteAt(int)</code></a></dd>
  751. </dl>
  752. </li>
  753. </ul>
  754. <a name="lookAhead--">
  755. <!-- -->
  756. </a>
  757. <ul class="blockList">
  758. <li class="blockList">
  759. <h4>lookAhead</h4>
  760. <pre>public&nbsp;int&nbsp;lookAhead()</pre>
  761. <div class="block">Obtains the value that the next call
  762. to <code>next()</code> will return.
  763. <p>This method is side-effects free.
  764. Successive calls to <code>lookAhead()</code> return the
  765. same value until <code>next()</code> is called.</div>
  766. </li>
  767. </ul>
  768. <a name="skipConstructor--">
  769. <!-- -->
  770. </a>
  771. <ul class="blockList">
  772. <li class="blockList">
  773. <h4>skipConstructor</h4>
  774. <pre>public&nbsp;int&nbsp;skipConstructor()
  775. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  776. <div class="block">Moves to the instruction for
  777. either <code>super()</code> or <code>this()</code>.
  778. <p>This method skips all the instructions for computing arguments
  779. to <code>super()</code> or <code>this()</code>, which should be
  780. placed at the beginning of a constructor body.
  781. <p>This method returns the index of INVOKESPECIAL instruction
  782. executing <code>super()</code> or <code>this()</code>.
  783. A successive call to <code>next()</code> returns the
  784. index of the next instruction following that INVOKESPECIAL.
  785. <p>This method works only for a constructor.</div>
  786. <dl>
  787. <dt><span class="returnLabel">Returns:</span></dt>
  788. <dd>the index of the INVOKESPECIAL instruction, or -1
  789. if a constructor invocation is not found.</dd>
  790. <dt><span class="throwsLabel">Throws:</span></dt>
  791. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  792. </dl>
  793. </li>
  794. </ul>
  795. <a name="skipSuperConstructor--">
  796. <!-- -->
  797. </a>
  798. <ul class="blockList">
  799. <li class="blockList">
  800. <h4>skipSuperConstructor</h4>
  801. <pre>public&nbsp;int&nbsp;skipSuperConstructor()
  802. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  803. <div class="block">Moves to the instruction for <code>super()</code>.
  804. <p>This method skips all the instructions for computing arguments to
  805. <code>super()</code>, which should be
  806. placed at the beginning of a constructor body.
  807. <p>This method returns the index of INVOKESPECIAL instruction
  808. executing <code>super()</code>.
  809. A successive call to <code>next()</code> returns the
  810. index of the next instruction following that INVOKESPECIAL.
  811. <p>This method works only for a constructor.</div>
  812. <dl>
  813. <dt><span class="returnLabel">Returns:</span></dt>
  814. <dd>the index of the INVOKESPECIAL instruction, or -1
  815. if a super constructor invocation is not found
  816. but <code>this()</code> is found.</dd>
  817. <dt><span class="throwsLabel">Throws:</span></dt>
  818. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  819. </dl>
  820. </li>
  821. </ul>
  822. <a name="skipThisConstructor--">
  823. <!-- -->
  824. </a>
  825. <ul class="blockList">
  826. <li class="blockList">
  827. <h4>skipThisConstructor</h4>
  828. <pre>public&nbsp;int&nbsp;skipThisConstructor()
  829. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  830. <div class="block">Moves to the instruction for <code>this()</code>.
  831. <p>This method skips all the instructions for computing arguments to
  832. <code>this()</code>, which should be
  833. placed at the beginning of a constructor body.
  834. <p>This method returns the index of INVOKESPECIAL instruction
  835. executing <code>this()</code>.
  836. A successive call to <code>next()</code> returns the
  837. index of the next instruction following that INVOKESPECIAL.
  838. <p>This method works only for a constructor.</div>
  839. <dl>
  840. <dt><span class="returnLabel">Returns:</span></dt>
  841. <dd>the index of the INVOKESPECIAL instruction, or -1
  842. if a explicit constructor invocation is not found
  843. but <code>super()</code> is found.</dd>
  844. <dt><span class="throwsLabel">Throws:</span></dt>
  845. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  846. </dl>
  847. </li>
  848. </ul>
  849. <a name="insert-byte:A-">
  850. <!-- -->
  851. </a>
  852. <ul class="blockList">
  853. <li class="blockList">
  854. <h4>insert</h4>
  855. <pre>public&nbsp;int&nbsp;insert&#8203;(byte[]&nbsp;code)
  856. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  857. <div class="block">Inserts the given bytecode sequence
  858. before the next instruction that would be returned by
  859. <code>next()</code> (not before the instruction returned
  860. by the last call to <code>next()</code>).
  861. Branch offsets and the exception table are also updated.
  862. <p>If the next instruction is at the beginning of a block statement,
  863. then the bytecode is inserted within that block.
  864. <p>An extra gap may be inserted at the end of the inserted
  865. bytecode sequence for adjusting alignment if the code attribute
  866. includes <code>LOOKUPSWITCH</code> or <code>TABLESWITCH</code>.</div>
  867. <dl>
  868. <dt><span class="paramLabel">Parameters:</span></dt>
  869. <dd><code>code</code> - inserted bytecode sequence.</dd>
  870. <dt><span class="returnLabel">Returns:</span></dt>
  871. <dd>the index indicating the first byte of the
  872. inserted byte sequence.</dd>
  873. <dt><span class="throwsLabel">Throws:</span></dt>
  874. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  875. </dl>
  876. </li>
  877. </ul>
  878. <a name="insert-int-byte:A-">
  879. <!-- -->
  880. </a>
  881. <ul class="blockList">
  882. <li class="blockList">
  883. <h4>insert</h4>
  884. <pre>public&nbsp;void&nbsp;insert&#8203;(int&nbsp;pos,
  885. byte[]&nbsp;code)
  886. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  887. <div class="block">Inserts the given bytecode sequence
  888. before the instruction at the given index <code>pos</code>.
  889. Branch offsets and the exception table are also updated.
  890. <p>If the instruction at the given index is at the beginning
  891. of a block statement,
  892. then the bytecode is inserted within that block.
  893. <p>An extra gap may be inserted at the end of the inserted
  894. bytecode sequence for adjusting alignment if the code attribute
  895. includes <code>LOOKUPSWITCH</code> or <code>TABLESWITCH</code>.
  896. <p>The index at which the byte sequence is actually inserted
  897. might be different from pos since some other bytes might be
  898. inserted at other positions (e.g. to change <code>GOTO</code>
  899. to <code>GOTO_W</code>).</div>
  900. <dl>
  901. <dt><span class="paramLabel">Parameters:</span></dt>
  902. <dd><code>pos</code> - the index at which a byte sequence is inserted.</dd>
  903. <dd><code>code</code> - inserted bytecode sequence.</dd>
  904. <dt><span class="throwsLabel">Throws:</span></dt>
  905. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  906. </dl>
  907. </li>
  908. </ul>
  909. <a name="insertAt-int-byte:A-">
  910. <!-- -->
  911. </a>
  912. <ul class="blockList">
  913. <li class="blockList">
  914. <h4>insertAt</h4>
  915. <pre>public&nbsp;int&nbsp;insertAt&#8203;(int&nbsp;pos,
  916. byte[]&nbsp;code)
  917. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  918. <div class="block">Inserts the given bytecode sequence
  919. before the instruction at the given index <code>pos</code>.
  920. Branch offsets and the exception table are also updated.
  921. <p>If the instruction at the given index is at the beginning
  922. of a block statement,
  923. then the bytecode is inserted within that block.
  924. <p>An extra gap may be inserted at the end of the inserted
  925. bytecode sequence for adjusting alignment if the code attribute
  926. includes <code>LOOKUPSWITCH</code> or <code>TABLESWITCH</code>.</div>
  927. <dl>
  928. <dt><span class="paramLabel">Parameters:</span></dt>
  929. <dd><code>pos</code> - the index at which a byte sequence is inserted.</dd>
  930. <dd><code>code</code> - inserted bytecode sequence.</dd>
  931. <dt><span class="returnLabel">Returns:</span></dt>
  932. <dd>the index indicating the first byte of the
  933. inserted byte sequence, which might be
  934. different from pos.</dd>
  935. <dt><span class="throwsLabel">Throws:</span></dt>
  936. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  937. <dt><span class="simpleTagLabel">Since:</span></dt>
  938. <dd>3.11</dd>
  939. </dl>
  940. </li>
  941. </ul>
  942. <a name="insertEx-byte:A-">
  943. <!-- -->
  944. </a>
  945. <ul class="blockList">
  946. <li class="blockList">
  947. <h4>insertEx</h4>
  948. <pre>public&nbsp;int&nbsp;insertEx&#8203;(byte[]&nbsp;code)
  949. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  950. <div class="block">Inserts the given bytecode sequence exclusively
  951. before the next instruction that would be returned by
  952. <code>next()</code> (not before the instruction returned
  953. by tha last call to <code>next()</code>).
  954. Branch offsets and the exception table are also updated.
  955. <p>If the next instruction is at the beginning of a block statement,
  956. then the bytecode is excluded from that block.
  957. <p>An extra gap may be inserted at the end of the inserted
  958. bytecode sequence for adjusting alignment if the code attribute
  959. includes <code>LOOKUPSWITCH</code> or <code>TABLESWITCH</code>.</div>
  960. <dl>
  961. <dt><span class="paramLabel">Parameters:</span></dt>
  962. <dd><code>code</code> - inserted bytecode sequence.</dd>
  963. <dt><span class="returnLabel">Returns:</span></dt>
  964. <dd>the index indicating the first byte of the
  965. inserted byte sequence.</dd>
  966. <dt><span class="throwsLabel">Throws:</span></dt>
  967. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  968. </dl>
  969. </li>
  970. </ul>
  971. <a name="insertEx-int-byte:A-">
  972. <!-- -->
  973. </a>
  974. <ul class="blockList">
  975. <li class="blockList">
  976. <h4>insertEx</h4>
  977. <pre>public&nbsp;void&nbsp;insertEx&#8203;(int&nbsp;pos,
  978. byte[]&nbsp;code)
  979. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  980. <div class="block">Inserts the given bytecode sequence exclusively
  981. before the instruction at the given index <code>pos</code>.
  982. Branch offsets and the exception table are also updated.
  983. <p>If the instruction at the given index is at the beginning
  984. of a block statement,
  985. then the bytecode is excluded from that block.
  986. <p>An extra gap may be inserted at the end of the inserted
  987. bytecode sequence for adjusting alignment if the code attribute
  988. includes <code>LOOKUPSWITCH</code> or <code>TABLESWITCH</code>.
  989. <p>The index at which the byte sequence is actually inserted
  990. might be different from pos since some other bytes might be
  991. inserted at other positions (e.g. to change <code>GOTO</code>
  992. to <code>GOTO_W</code>).</div>
  993. <dl>
  994. <dt><span class="paramLabel">Parameters:</span></dt>
  995. <dd><code>pos</code> - the index at which a byte sequence is inserted.</dd>
  996. <dd><code>code</code> - inserted bytecode sequence.</dd>
  997. <dt><span class="throwsLabel">Throws:</span></dt>
  998. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  999. </dl>
  1000. </li>
  1001. </ul>
  1002. <a name="insertExAt-int-byte:A-">
  1003. <!-- -->
  1004. </a>
  1005. <ul class="blockList">
  1006. <li class="blockList">
  1007. <h4>insertExAt</h4>
  1008. <pre>public&nbsp;int&nbsp;insertExAt&#8203;(int&nbsp;pos,
  1009. byte[]&nbsp;code)
  1010. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  1011. <div class="block">Inserts the given bytecode sequence exclusively
  1012. before the instruction at the given index <code>pos</code>.
  1013. Branch offsets and the exception table are also updated.
  1014. <p>If the instruction at the given index is at the beginning
  1015. of a block statement,
  1016. then the bytecode is excluded from that block.
  1017. <p>An extra gap may be inserted at the end of the inserted
  1018. bytecode sequence for adjusting alignment if the code attribute
  1019. includes <code>LOOKUPSWITCH</code> or <code>TABLESWITCH</code>.</div>
  1020. <dl>
  1021. <dt><span class="paramLabel">Parameters:</span></dt>
  1022. <dd><code>pos</code> - the index at which a byte sequence is inserted.</dd>
  1023. <dd><code>code</code> - inserted bytecode sequence.</dd>
  1024. <dt><span class="returnLabel">Returns:</span></dt>
  1025. <dd>the index indicating the first byte of the
  1026. inserted byte sequence, which might be
  1027. different from pos.</dd>
  1028. <dt><span class="throwsLabel">Throws:</span></dt>
  1029. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  1030. <dt><span class="simpleTagLabel">Since:</span></dt>
  1031. <dd>3.11</dd>
  1032. </dl>
  1033. </li>
  1034. </ul>
  1035. <a name="insertGap-int-">
  1036. <!-- -->
  1037. </a>
  1038. <ul class="blockList">
  1039. <li class="blockList">
  1040. <h4>insertGap</h4>
  1041. <pre>public&nbsp;int&nbsp;insertGap&#8203;(int&nbsp;length)
  1042. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  1043. <div class="block">Inserts a gap
  1044. before the next instruction that would be returned by
  1045. <code>next()</code> (not before the instruction returned
  1046. by the last call to <code>next()</code>).
  1047. Branch offsets and the exception table are also updated.
  1048. The inserted gap is filled with NOP. The gap length may be
  1049. extended to a multiple of 4.
  1050. <p>If the next instruction is at the beginning of a block statement,
  1051. then the gap is inserted within that block.</div>
  1052. <dl>
  1053. <dt><span class="paramLabel">Parameters:</span></dt>
  1054. <dd><code>length</code> - gap length</dd>
  1055. <dt><span class="returnLabel">Returns:</span></dt>
  1056. <dd>the index indicating the first byte of the inserted gap.</dd>
  1057. <dt><span class="throwsLabel">Throws:</span></dt>
  1058. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  1059. </dl>
  1060. </li>
  1061. </ul>
  1062. <a name="insertGap-int-int-">
  1063. <!-- -->
  1064. </a>
  1065. <ul class="blockList">
  1066. <li class="blockList">
  1067. <h4>insertGap</h4>
  1068. <pre>public&nbsp;int&nbsp;insertGap&#8203;(int&nbsp;pos,
  1069. int&nbsp;length)
  1070. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  1071. <div class="block">Inserts a gap in front of the instruction at the given
  1072. index <code>pos</code>.
  1073. Branch offsets and the exception table are also updated.
  1074. The inserted gap is filled with NOP. The gap length may be
  1075. extended to a multiple of 4.
  1076. <p>If the instruction at the given index is at the beginning
  1077. of a block statement,
  1078. then the gap is inserted within that block.</div>
  1079. <dl>
  1080. <dt><span class="paramLabel">Parameters:</span></dt>
  1081. <dd><code>pos</code> - the index at which a gap is inserted.</dd>
  1082. <dd><code>length</code> - gap length.</dd>
  1083. <dt><span class="returnLabel">Returns:</span></dt>
  1084. <dd>the length of the inserted gap.
  1085. It might be bigger than <code>length</code>.</dd>
  1086. <dt><span class="throwsLabel">Throws:</span></dt>
  1087. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  1088. </dl>
  1089. </li>
  1090. </ul>
  1091. <a name="insertExGap-int-">
  1092. <!-- -->
  1093. </a>
  1094. <ul class="blockList">
  1095. <li class="blockList">
  1096. <h4>insertExGap</h4>
  1097. <pre>public&nbsp;int&nbsp;insertExGap&#8203;(int&nbsp;length)
  1098. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  1099. <div class="block">Inserts an exclusive gap
  1100. before the next instruction that would be returned by
  1101. <code>next()</code> (not before the instruction returned
  1102. by the last call to <code>next()</code>).
  1103. Branch offsets and the exception table are also updated.
  1104. The inserted gap is filled with NOP. The gap length may be
  1105. extended to a multiple of 4.
  1106. <p>If the next instruction is at the beginning of a block statement,
  1107. then the gap is excluded from that block.</div>
  1108. <dl>
  1109. <dt><span class="paramLabel">Parameters:</span></dt>
  1110. <dd><code>length</code> - gap length</dd>
  1111. <dt><span class="returnLabel">Returns:</span></dt>
  1112. <dd>the index indicating the first byte of the inserted gap.</dd>
  1113. <dt><span class="throwsLabel">Throws:</span></dt>
  1114. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  1115. </dl>
  1116. </li>
  1117. </ul>
  1118. <a name="insertExGap-int-int-">
  1119. <!-- -->
  1120. </a>
  1121. <ul class="blockList">
  1122. <li class="blockList">
  1123. <h4>insertExGap</h4>
  1124. <pre>public&nbsp;int&nbsp;insertExGap&#8203;(int&nbsp;pos,
  1125. int&nbsp;length)
  1126. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  1127. <div class="block">Inserts an exclusive gap in front of the instruction at the given
  1128. index <code>pos</code>.
  1129. Branch offsets and the exception table are also updated.
  1130. The inserted gap is filled with NOP. The gap length may be
  1131. extended to a multiple of 4.
  1132. <p>If the instruction at the given index is at the beginning
  1133. of a block statement,
  1134. then the gap is excluded from that block.</div>
  1135. <dl>
  1136. <dt><span class="paramLabel">Parameters:</span></dt>
  1137. <dd><code>pos</code> - the index at which a gap is inserted.</dd>
  1138. <dd><code>length</code> - gap length.</dd>
  1139. <dt><span class="returnLabel">Returns:</span></dt>
  1140. <dd>the length of the inserted gap.
  1141. It might be bigger than <code>length</code>.</dd>
  1142. <dt><span class="throwsLabel">Throws:</span></dt>
  1143. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  1144. </dl>
  1145. </li>
  1146. </ul>
  1147. <a name="insertGapAt-int-int-boolean-">
  1148. <!-- -->
  1149. </a>
  1150. <ul class="blockList">
  1151. <li class="blockList">
  1152. <h4>insertGapAt</h4>
  1153. <pre>public&nbsp;<a href="../../javassist/bytecode/CodeIterator.Gap.html" title="class in javassist.bytecode">CodeIterator.Gap</a>&nbsp;insertGapAt&#8203;(int&nbsp;pos,
  1154. int&nbsp;length,
  1155. boolean&nbsp;exclusive)
  1156. throws <a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></pre>
  1157. <div class="block">Inserts an inclusive or exclusive gap in front of the instruction
  1158. at the given index <code>pos</code>.
  1159. Branch offsets and the exception table in the method body
  1160. are also updated. The inserted gap is filled with NOP.
  1161. The gap length may be extended to a multiple of 4.
  1162. <p>Suppose that the instruction at the given index is at the
  1163. beginning of a block statement. If the gap is inclusive,
  1164. then it is included within that block. If the gap is exclusive,
  1165. then it is excluded from that block.
  1166. <p>The index at which the gap is actually inserted
  1167. might be different from pos since some other bytes might be
  1168. inserted at other positions (e.g. to change <code>GOTO</code>
  1169. to <code>GOTO_W</code>). The index is available from the <code>Gap</code>
  1170. object returned by this method.
  1171. <p>Suppose that the gap is inserted at the position of
  1172. the next instruction that would be returned by
  1173. <code>next()</code> (not the last instruction returned
  1174. by the last call to <code>next()</code>). The next
  1175. instruction returned by <code>next()</code> after the gap is
  1176. inserted is still the same instruction. It is not <code>NOP</code>
  1177. at the first byte of the inserted gap.</div>
  1178. <dl>
  1179. <dt><span class="paramLabel">Parameters:</span></dt>
  1180. <dd><code>pos</code> - the index at which a gap is inserted.</dd>
  1181. <dd><code>length</code> - gap length.</dd>
  1182. <dd><code>exclusive</code> - true if exclusive, otherwise false.</dd>
  1183. <dt><span class="returnLabel">Returns:</span></dt>
  1184. <dd>the position and the length of the inserted gap.</dd>
  1185. <dt><span class="throwsLabel">Throws:</span></dt>
  1186. <dd><code><a href="../../javassist/bytecode/BadBytecode.html" title="class in javassist.bytecode">BadBytecode</a></code></dd>
  1187. <dt><span class="simpleTagLabel">Since:</span></dt>
  1188. <dd>3.11</dd>
  1189. </dl>
  1190. </li>
  1191. </ul>
  1192. <a name="insert-javassist.bytecode.ExceptionTable-int-">
  1193. <!-- -->
  1194. </a>
  1195. <ul class="blockList">
  1196. <li class="blockList">
  1197. <h4>insert</h4>
  1198. <pre>public&nbsp;void&nbsp;insert&#8203;(<a href="../../javassist/bytecode/ExceptionTable.html" title="class in javassist.bytecode">ExceptionTable</a>&nbsp;et,
  1199. int&nbsp;offset)</pre>
  1200. <div class="block">Copies and inserts the entries in the given exception table
  1201. at the beginning of the exception table in the code attribute
  1202. edited by this object.</div>
  1203. <dl>
  1204. <dt><span class="paramLabel">Parameters:</span></dt>
  1205. <dd><code>offset</code> - the value added to the code positions included
  1206. in the entries.</dd>
  1207. </dl>
  1208. </li>
  1209. </ul>
  1210. <a name="append-byte:A-">
  1211. <!-- -->
  1212. </a>
  1213. <ul class="blockList">
  1214. <li class="blockList">
  1215. <h4>append</h4>
  1216. <pre>public&nbsp;int&nbsp;append&#8203;(byte[]&nbsp;code)</pre>
  1217. <div class="block">Appends the given bytecode sequence at the end.</div>
  1218. <dl>
  1219. <dt><span class="paramLabel">Parameters:</span></dt>
  1220. <dd><code>code</code> - the bytecode appended.</dd>
  1221. <dt><span class="returnLabel">Returns:</span></dt>
  1222. <dd>the position of the first byte of the appended bytecode.</dd>
  1223. </dl>
  1224. </li>
  1225. </ul>
  1226. <a name="appendGap-int-">
  1227. <!-- -->
  1228. </a>
  1229. <ul class="blockList">
  1230. <li class="blockList">
  1231. <h4>appendGap</h4>
  1232. <pre>public&nbsp;void&nbsp;appendGap&#8203;(int&nbsp;gapLength)</pre>
  1233. <div class="block">Appends a gap at the end of the bytecode sequence.</div>
  1234. <dl>
  1235. <dt><span class="paramLabel">Parameters:</span></dt>
  1236. <dd><code>gapLength</code> - gap length</dd>
  1237. </dl>
  1238. </li>
  1239. </ul>
  1240. <a name="append-javassist.bytecode.ExceptionTable-int-">
  1241. <!-- -->
  1242. </a>
  1243. <ul class="blockListLast">
  1244. <li class="blockList">
  1245. <h4>append</h4>
  1246. <pre>public&nbsp;void&nbsp;append&#8203;(<a href="../../javassist/bytecode/ExceptionTable.html" title="class in javassist.bytecode">ExceptionTable</a>&nbsp;et,
  1247. int&nbsp;offset)</pre>
  1248. <div class="block">Copies and appends the entries in the given exception table
  1249. at the end of the exception table in the code attribute
  1250. edited by this object.</div>
  1251. <dl>
  1252. <dt><span class="paramLabel">Parameters:</span></dt>
  1253. <dd><code>offset</code> - the value added to the code positions included
  1254. in the entries.</dd>
  1255. </dl>
  1256. </li>
  1257. </ul>
  1258. </li>
  1259. </ul>
  1260. </li>
  1261. </ul>
  1262. </div>
  1263. </div>
  1264. <!-- ========= END OF CLASS DATA ========= -->
  1265. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  1266. <div class="bottomNav"><a name="navbar.bottom">
  1267. <!-- -->
  1268. </a>
  1269. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  1270. <a name="navbar.bottom.firstrow">
  1271. <!-- -->
  1272. </a>
  1273. <ul class="navList" title="Navigation">
  1274. <li><a href="../../overview-summary.html">Overview</a></li>
  1275. <li><a href="package-summary.html">Package</a></li>
  1276. <li class="navBarCell1Rev">Class</li>
  1277. <li><a href="class-use/CodeIterator.html">Use</a></li>
  1278. <li><a href="package-tree.html">Tree</a></li>
  1279. <li><a href="../../deprecated-list.html">Deprecated</a></li>
  1280. <li><a href="../../index-all.html">Index</a></li>
  1281. </ul>
  1282. </div>
  1283. <div class="subNav">
  1284. <ul class="navList">
  1285. <li><a href="../../javassist/bytecode/CodeAttribute.RuntimeCopyException.html" title="class in javassist.bytecode"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  1286. <li><a href="../../javassist/bytecode/CodeIterator.Gap.html" title="class in javassist.bytecode"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  1287. </ul>
  1288. <ul class="navList">
  1289. <li><a href="../../index.html?javassist/bytecode/CodeIterator.html" target="_top">Frames</a></li>
  1290. <li><a href="CodeIterator.html" target="_top">No&nbsp;Frames</a></li>
  1291. </ul>
  1292. <ul class="navList" id="allclasses_navbar_bottom">
  1293. <li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  1294. </ul>
  1295. <div>
  1296. <script type="text/javascript"><!--
  1297. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  1298. if(window==top) {
  1299. allClassesLink.style.display = "block";
  1300. }
  1301. else {
  1302. allClassesLink.style.display = "none";
  1303. }
  1304. //-->
  1305. </script>
  1306. <noscript>
  1307. <div>JavaScript is disabled on your browser.</div>
  1308. </noscript>
  1309. </div>
  1310. <div>
  1311. <ul class="subNavList">
  1312. <li>Summary:&nbsp;</li>
  1313. <li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
  1314. <li>Field&nbsp;|&nbsp;</li>
  1315. <li>Constr&nbsp;|&nbsp;</li>
  1316. <li><a href="#method.summary">Method</a></li>
  1317. </ul>
  1318. <ul class="subNavList">
  1319. <li>Detail:&nbsp;</li>
  1320. <li>Field&nbsp;|&nbsp;</li>
  1321. <li>Constr&nbsp;|&nbsp;</li>
  1322. <li><a href="#method.detail">Method</a></li>
  1323. </ul>
  1324. </div>
  1325. <a name="skip.navbar.bottom">
  1326. <!-- -->
  1327. </a></div>
  1328. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  1329. <p class="legalCopy"><small><i>Javassist, a Java-bytecode translator toolkit.<br>
  1330. Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.</i></small></p>
  1331. </body>
  1332. </html>