Resolves a constants value from the constant pool to the lowest form it
can be represented by. E.g. String, Integer, Float, etc.

@author gcmurphy
@param index
@param cp
@return
331889
public static String constantValue(int index, ConstantPool cp) {
        Constant type = cp.getConstant(index);
        if (type != null) {
            switch (type.getTag()) {
            case Constants.CONSTANT_Class:
                ConstantClass cls = (ConstantClass) type;
                return constantValue(cls.getNameIndex(), cp);

            case Constants.CONSTANT_Double:
                ConstantDouble dbl = (ConstantDouble) type;
                return String.valueOf(dbl.getBytes());

            case Constants.CONSTANT_Fieldref:
                ConstantFieldref fieldRef = (ConstantFieldref) type;
                return constantValue(fieldRef.getClassIndex(), cp) + " "
                        + constantValue(fieldRef.getNameAndTypeIndex(), cp);

            case Constants.CONSTANT_Float:
                ConstantFloat flt = (ConstantFloat) type;
                return String.valueOf(flt.getBytes());

            case Constants.CONSTANT_Integer:
                ConstantInteger integer = (ConstantInteger) type;
                return String.valueOf(integer.getBytes());

            case Constants.CONSTANT_InterfaceMethodref:
                ConstantInterfaceMethodref intRef = (ConstantInterfaceMethodref) type;
                return constantValue(intRef.getClassIndex(), cp) + " "
                        + constantValue(intRef.getNameAndTypeIndex(), cp);

            case Constants.CONSTANT_Long:
                ConstantLong lng = (ConstantLong) type;
                return String.valueOf(lng.getBytes());

            case Constants.CONSTANT_Methodref:
                ConstantMethodref methRef = (ConstantMethodref) type;
                return constantValue(methRef.getClassIndex(), cp) + " "
                        + constantValue(methRef.getNameAndTypeIndex(), cp);

            case Constants.CONSTANT_NameAndType:
                ConstantNameAndType nameType = (ConstantNameAndType) type;
                return nameType.getName(cp) + " " + nameType.getSignature(cp);

            case Constants.CONSTANT_String:
                ConstantString str = (ConstantString) type;
                return str.getBytes(cp);

            case Constants.CONSTANT_Utf8:
                ConstantUtf8 utf8 = (ConstantUtf8) type;
                return utf8.getBytes();
            }
        }
        return "";
    }
786582
protected Attribute resolveNamespaceDecl(int index, boolean internURI)
    {
        Attribute ns = mNamespaces[index];
        String full = mNamespaceBuilder.getAllValues();
        String uri;

        if (mNsCount == 0) {
            uri = full;
        } else {
            ++index;
            if (index < mNsCount) { // not last
                int endOffset = mNamespaces[index].mValueStartOffset;
                uri = ns.getValue(full, endOffset);
            } else { // is last
                uri = ns.getValue(full);
            }
        }
        if (internURI && uri.length() > 0) {
            uri = sInternCache.intern(uri);
        }
        ns.mNamespaceURI = uri;
        return ns;
    }
418145
Object getIndexedType(int index)
    {
        Object ae = indexedElementMap.get(index);
        if (ae == null)
        {
            throw new VerifyError("constant pool at "+index+" not proper type");
        }
        return ae;
    }
1160849
public double getValueAt( int index ) {

        int row = index / data[0].length;
        int col = index % data[0].length;

        return data[row][col];
    }
740982
public static final String getString(int index, boolean lowercase) {
		if (index < 1) return "";
	    index--;
	    	
	    int bytes = 1;
	    int start = 0;
	    int symbols = 24;  
	   	while(index >= symbols + start) {
	   		bytes++;
	   	    start += symbols;
	   		symbols *= 24;
	   	}
	   	      
	   	int c = index - start;
	   	char[] value = new char[bytes];
	   	while(bytes > 0) {
	   		bytes--;
	   		value[bytes] = (char)(c % 24);
	   		if (value[bytes] > 16) value[bytes]++;
	   		value[bytes] += (lowercase ? 945 : 913);
	   		value[bytes] = SpecialSymbol.getCorrespondingSymbol(value[bytes]);
	   		c /= 24;
	   	}
	   	
	   	return String.valueOf(value);
	}
1280007
private FloatConstant parseFloatConstant(int index)
    throws IOException
  {
    int bits = readInt();

    float value = Float.intBitsToFloat(bits);

    return new FloatConstant(_class.getConstantPool(), index, value);
  }
1058351
private DoubleConstant parseDoubleConstant(int index)
    throws IOException
  {
    long bits = readLong();

    double value = Double.longBitsToDouble(bits);

    return new DoubleConstant(_class.getConstantPool(), index, value);
  }
44189
static ConstantDoubleInfo make(ConstantPool cp, double value) {
        ConstantInfo ci = new ConstantDoubleInfo(value);
        return (ConstantDoubleInfo)cp.addConstant(ci);
    }
978173
public final int getConstantIndex(float constant)
    {
        for (ConstantInfo ci : listConstantInfo(ConstantFloat.class))
        {
            ConstantFloat ic = (ConstantFloat) ci;
            if (Float.compare(constant, ic.getConstant()) == 0)
            {
                return constantPoolIndexMap.get(ci);
            }
        }
        return -1;
    }
863465
public float getFloat(int index)
    {
        checkIndexLength(index, SizeOf.SIZE_OF_FLOAT);
        return unsafe.getFloat(base, address + index);
    }
1179628
public String getParamValue(int index) {
        return (index < params.size()) ? params.get(index).getValue() : null;
    }
1152602
public double getValueAt(int index) {
		if(index <0 || index>=insertSeq.size())
			throw new IndexOutOfBoundsException();
		return insertSeq.get(index);
	}
736641
public float getValueAsFloat(int index) throws IOException {
        if (index >= structure.valueSizes.size()) {
            throw new IOException("Index " + index + " is out of range.");
        }
        return Bytes.toFloat(value, structure.valueByteOffsets.get(index));
    }
786979
public Object get(int index) {
        return HprofInstanceValue.getTypeValue(dumpBuffer, offset + ((long)index * (long)elSize), type).toString();
    }
941386
static ConstantStringInfo make(ConstantPool cp, String str) {
        ConstantInfo ci = new ConstantStringInfo(cp, str);
        return (ConstantStringInfo)cp.addConstant(ci);
    }
848443
private void checkConstantPoolIndex(int index) throws InvalidClassFileFormatException {
        if (index < 0 || index >= constantPool.length || constantPool[index] == null) {
            throw new InvalidClassFileFormatException(expectedClassDescriptor, codeBaseEntry);
        }
    }
1174574
private LongConstant parseLongConstant(int index)
    throws IOException
  {
    long value = readLong();

    return new LongConstant(_class.getConstantPool(), index, value);
  }