Methods Summary |
---|
public final int | getIndex()Gets the item index.
if (index < 0) {
throw new RuntimeException("index not yet set");
}
return index;
|
public final boolean | hasIndex()Gets whether or not this instance has been assigned an index.
return (index >= 0);
|
public final java.lang.String | indexString()Gets the index of this item as a string, suitable for including in
annotations.
return '[" + Integer.toHexString(index) + ']";
|
public final void | setIndex(int index)Sets the item index. This method may only ever be called once
per instance, and this will throw a RuntimeException if
called a second (or subsequent) time.
if (this.index != -1) {
throw new RuntimeException("index already set");
}
this.index = index;
|