Lines Matching refs:index

34      * {@code >= -1;} the constant pool index for {@link #constant}, or
37 private int index;
40 * {@code >= -1;} the constant pool index for the class reference in
47 * initially unknown ({@code -1}) as is the constant pool index.
65 this.index = -1;
75 if (index >= 0) {
76 result.setIndex(index);
92 if (index >= 0) {
93 result.setIndex(index);
113 * Gets the constant's index. It is only valid to call this after
116 * @return {@code >= 0;} the constant pool index
119 if (index < 0) {
120 throw new IllegalStateException("index not yet set for " + constant);
123 return index;
127 * Returns whether the constant's index has been set for this instance.
131 * @return {@code true} iff the index has been set
134 return (index >= 0);
138 * Sets the constant's index. It is only valid to call this method once
141 * @param index {@code index >= 0;} the constant pool index
143 public void setIndex(int index) {
144 if (index < 0) {
145 throw new IllegalArgumentException("index < 0");
148 if (this.index >= 0) {
149 throw new IllegalStateException("index already set");
152 this.index = index;
156 * Gets the constant's class index. It is only valid to call this after
159 * @return {@code >= 0;} the constant's class's constant pool index
163 throw new IllegalStateException("class index not yet set");
170 * Returns whether the constant's class index has been set for this
175 * @return {@code true} iff the index has been set
182 * Sets the constant's class index. This is the constant pool index
188 * @param index {@code index >= 0;} the constant's class's constant pool index
190 public void setClassIndex(int index) {
191 if (index < 0) {
192 throw new IllegalArgumentException("index < 0");
196 throw new IllegalStateException("class index already set");
199 this.classIndex = index;
228 if (index < 65536) {
229 sb.append(Hex.u2(index));
231 sb.append(Hex.u4(index));