edu.wisc.cs.java
Class Descriptor
java.lang.Object
|
+--edu.wisc.cs.java.Descriptor
- public class Descriptor
- extends java.lang.Object
This class us used for parsing descriptors of methods and fields.
Constructor Summary |
Descriptor(java.lang.String desc)
Constructs a new descriptor object from a string. |
Method Summary |
int |
getMemberType()
Returns the type of this desctiptor. |
int |
getNParams()
Returns the number of parameters specified by this descriptor. |
java.lang.String |
getParameter(int i)
Returns the the descriptor of a parameter. |
java.lang.String |
getType()
Returns the type of this descriptor. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
VARIABLE
public static final int VARIABLE
METHOD
public static final int METHOD
VOID
public static final char VOID
ARRAY
public static final char ARRAY
OBJECT
public static final char OBJECT
FLOAT
public static final char FLOAT
DOUBLE
public static final char DOUBLE
BYTE
public static final char BYTE
SHORT
public static final char SHORT
CHAR
public static final char CHAR
INT
public static final char INT
LONG
public static final char LONG
BOOLEAN
public static final char BOOLEAN
Descriptor
public Descriptor(java.lang.String desc)
- Constructs a new descriptor object from a string.
- Parameters:
desc
- a string containing a type descriptor.
getMemberType
public int getMemberType()
- Returns the type of this desctiptor.
- Returns:
- the type of this desctiptor.
- See Also:
VARIABLE
,
METHOD
getType
public java.lang.String getType()
- Returns the type of this descriptor. The type is considered to be the
whole descriptor if it is a VARIABLE descriptor, or the return type if
it is a METHOD descriptor.
- Returns:
- the type of this descriptor.
getNParams
public int getNParams()
- Returns the number of parameters specified by this descriptor.
- Returns:
- the number of parameters specified by this descriptor.
getParameter
public java.lang.String getParameter(int i)
- Returns the the descriptor of a parameter.
- Parameters:
i
- the index of the parameter to return.- Returns:
- the the descriptor of a parameter.