FileDocCategorySizeDatePackage
ProfileMethodClass.javaAPI DocExample5290Mon Dec 28 21:46:02 GMT 1998tuning.profview

ProfileMethodClass.java

package tuning.profview;

/**
 * This class was generated by a SmartGuide.
 * 
 */
public class ProfileMethodClass 
{
	String classname;
	int arraydepth;
	public static final ProfileMethodClass long_ = new ProfileMethodClass(false,"long");
	public static final ProfileMethodClass int_ = new ProfileMethodClass(false,"int");
	public static final ProfileMethodClass char_ = new ProfileMethodClass(false,"char");
	public static final ProfileMethodClass short_ = new ProfileMethodClass(false,"short");
	public static final ProfileMethodClass byte_ = new ProfileMethodClass(false,"byte");
	public static final ProfileMethodClass double_ = new ProfileMethodClass(false,"double");
	public static final ProfileMethodClass float_ = new ProfileMethodClass(false,"float");
	public static final ProfileMethodClass boolean_ = new ProfileMethodClass(false,"boolean");
	public static final ProfileMethodClass void_ = new ProfileMethodClass(false,"void");
	public static final ProfileMethodClass long_x = new ProfileMethodClass(true,"long");
	public static final ProfileMethodClass int_x = new ProfileMethodClass(true,"int");
	public static final ProfileMethodClass char_x = new ProfileMethodClass(true,"char");
	public static final ProfileMethodClass short_x = new ProfileMethodClass(true,"short");
	public static final ProfileMethodClass byte_x = new ProfileMethodClass(true,"byte");
	public static final ProfileMethodClass double_x = new ProfileMethodClass(true,"double");
	public static final ProfileMethodClass float_x = new ProfileMethodClass(true,"float");
	public static final ProfileMethodClass boolean_x = new ProfileMethodClass(true,"boolean");
	public static final ProfileMethodClass void_x = new ProfileMethodClass(true,"void");

/**
 * This method was created by a SmartGuide.
 * @param classname java.lang.String
 */
public ProfileMethodClass(boolean isArray, String classname)
{
	this.arraydepth = isArray ? 1 : 0;
	this.classname = classname;
}
public ProfileMethodClass(int arraydepth, String classname)
{
	this.arraydepth = arraydepth;
	this.classname = classname;
}
/**
 * This method was created by a SmartGuide.
 * @param s java.lang.StringBuffer
 */
public void appendTo(StringBuffer s)
{
	s.append(classname);
	for (int i = arraydepth ; i > 0; i--)
		s.append("[]");
}
/**
 * This method was created by a SmartGuide.
 */
public static ProfileMethodClass[] getClasses(String classname)
{
	return getClasses(classname,0);
}
/**
 * This method was created by a SmartGuide.
 */
static ProfileMethodClass[] getClasses(String classname, int position)
{
	int length = classname.length();
	java.util.Vector v = new java.util.Vector();
	boolean isArray;
	int arrdepth=0;
	while(position < length)
	{
		isArray = false;
		if (classname.charAt(position) == '[')
		{
			isArray = true;
			arrdepth++;
			position++;
			while(classname.charAt(position) == '[')
			{
    			position++;
    			arrdepth++;
    		}
		}
		switch(classname.charAt(position))
		{
			case 'J':
				position++;
				v.addElement(isArray ? 
				 (arrdepth<2 ? ProfileMethodClass.long_x : ProfileMethodClass.long_):
				 new ProfileMethodClass(isArray,"long"));
				break;
			case 'I':
				position++;
				v.addElement(isArray ? 
				 (arrdepth<2 ? ProfileMethodClass.int_x : ProfileMethodClass.int_):
				 new ProfileMethodClass(isArray,"int"));
				break;
			case 'C':
				position++;
				v.addElement(isArray ? 
				 (arrdepth<2 ? ProfileMethodClass.char_x : ProfileMethodClass.char_):
				 new ProfileMethodClass(isArray,"char"));
				break;
			case 'B':
				position++;
				v.addElement(isArray ? 
				 (arrdepth<2 ? ProfileMethodClass.byte_x : ProfileMethodClass.byte_):
				 new ProfileMethodClass(isArray,"byte"));
				break;
			case 'S':
				position++;
				v.addElement(isArray ? 
				 (arrdepth<2 ? ProfileMethodClass.short_x : ProfileMethodClass.short_):
				 new ProfileMethodClass(isArray,"short"));
				break;
			case 'V':
				position++;
				v.addElement(isArray ? 
				 (arrdepth<2 ? ProfileMethodClass.void_x : ProfileMethodClass.void_):
				 new ProfileMethodClass(isArray,"void"));
				break;
			case 'F':
				position++;
				v.addElement(isArray ? 
				 (arrdepth<2 ? ProfileMethodClass.float_x : ProfileMethodClass.float_):
				 new ProfileMethodClass(isArray,"float"));
				break;
			case 'D':
				position++;
				v.addElement(isArray ? 
				 (arrdepth<2 ? ProfileMethodClass.double_x : ProfileMethodClass.double_):
				 new ProfileMethodClass(isArray,"double"));
				break;
			case 'Z':
				position++;
				v.addElement(isArray ? 
				 (arrdepth<2 ? ProfileMethodClass.boolean_x : ProfileMethodClass.boolean_):
				 new ProfileMethodClass(isArray,"boolean"));
				break;
			case 'L':
				position++;
				v.addElement(new ProfileMethodClass(isArray,
						classname.substring(position,
							(position = classname.indexOf(';',position))).replace('/','.')));
				position++;
				break;
			default:
				throw new IllegalArgumentException("Unkown type: " + classname);
		}
	}
	ProfileMethodClass[] ret = new ProfileMethodClass[length = v.size()];
	for (int i = 0; i < length; i++)
		ret[i] = (ProfileMethodClass) v.elementAt(i);
	return ret;
}
}