Home | History | Annotate | Download | only in file

Lines Matching refs:index

20  * An item in a Dalvik file which is referenced by index.
23 /** {@code >= -1;} assigned index of the item, or {@code -1} if not
25 private int index;
28 * Constructs an instance. The index is initially unassigned.
31 index = -1;
35 * Gets whether or not this instance has been assigned an index.
37 * @return {@code true} iff this instance has been assigned an index
40 return (index >= 0);
44 * Gets the item index.
46 * @return {@code >= 0;} the index
47 * @throws RuntimeException thrown if the item index is not yet assigned
50 if (index < 0) {
51 throw new RuntimeException("index not yet set");
54 return index;
58 * Sets the item index. This method may only ever be called once
62 * @param index {@code >= 0;} the item index
64 public final void setIndex(int index) {
65 if (this.index != -1) {
66 throw new RuntimeException("index already set");
69 this.index = index;
73 * Gets the index of this item as a string, suitable for including in
76 * @return {@code non-null;} the index string
79 return '[' + Integer.toHexString(index) + ']';