/**
   * Look for ConstantInteger in ConstantPool.
   *
   * @param n integer number to look for
   * @return index on success, -1 otherwise
   */
  public int lookupInteger(int n) {
    for (int i = 1; i < index; i++) {
      if (constants[i] instanceof ConstantInteger) {
        ConstantInteger c = (ConstantInteger) constants[i];

        if (c.getBytes() == n) return i;
      }
    }

    return -1;
  }
Example #2
0
 public void visitConstantInteger(ConstantInteger constant) {
   constant.accept(visitor);
 }