Package org.aspectj.apache.bcel.classfile

Examples of org.aspectj.apache.bcel.classfile.ConstantInteger


   
    // Whatever kind of value it is, return it as a string
    public String stringifyValue() {
      switch (type) {
        case PRIMITIVE_INT:
          ConstantInteger c = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer);
        return Integer.toString(c.getBytes());
        case PRIMITIVE_LONG:
          ConstantLong j = (ConstantLong)cpool.getConstant(idx,Constants.CONSTANT_Long);
        return Long.toString(j.getBytes());
        case PRIMITIVE_DOUBLE:
          ConstantDouble d = (ConstantDouble)cpool.getConstant(idx,Constants.CONSTANT_Double);
        return Double.toString(d.getBytes());
        case PRIMITIVE_FLOAT:
          ConstantFloat f = (ConstantFloat)cpool.getConstant(idx,Constants.CONSTANT_Float);
        return Float.toString(f.getBytes());
        case PRIMITIVE_SHORT:
        ConstantInteger s = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer);
        return Integer.toString(s.getBytes());
        case PRIMITIVE_BYTE:
        ConstantInteger b = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer);
        return Integer.toString(b.getBytes());
        case PRIMITIVE_CHAR:
        ConstantInteger ch = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer);
        return Integer.toString(ch.getBytes());
        case PRIMITIVE_BOOLEAN:
        ConstantInteger bo = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer);
        if (bo.getBytes() == 0) return "false";
        if (bo.getBytes() != 0) return "true";
        case STRING:
        ConstantUtf8 cu8 = (ConstantUtf8)cpool.getConstant(idx,Constants.CONSTANT_Utf8);
        return cu8.getBytes();
       
       default:
View Full Code Here


   * @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;
View Full Code Here

      return ret; // Already in CP

    adjustSize();

    ret = index;
    constants[index++] = new ConstantInteger(n);

    return ret;
  }
View Full Code Here

TOP

Related Classes of org.aspectj.apache.bcel.classfile.ConstantInteger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.