com.ibm.wala.types
Class Descriptor

java.lang.Object
  extended by com.ibm.wala.types.Descriptor

public final class Descriptor
extends java.lang.Object

A method descriptor; something like: (Ljava/langString;)Ljava/lang/Class; Descriptors are canonical


Method Summary
 boolean equals(java.lang.Object obj)
           
static Descriptor findOrCreate(ImmutableByteArray b)
           
static Descriptor findOrCreate(TypeName[] parameters, TypeName returnType)
           
static Descriptor findOrCreateUTF8(java.lang.String s)
           
 int getNumberOfParameters()
           
 TypeName[] getParameters()
           
 TypeName getReturnType()
           
 int hashCode()
           
 java.lang.String toString()
           
 java.lang.String toUnicodeString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

findOrCreate

public static Descriptor findOrCreate(TypeName[] parameters,
                                      TypeName returnType)
Parameters:
parameters - the parameters for a descriptor
returnType - the return type
Returns:
the canonical representative for this descriptor value

findOrCreate

public static Descriptor findOrCreate(ImmutableByteArray b)
                               throws java.lang.IllegalArgumentException
Parameters:
b - a byte array holding the string representation of this descriptor
Returns:
the canonical representative for this descriptor value
Throws:
java.lang.IllegalArgumentException

findOrCreateUTF8

public static Descriptor findOrCreateUTF8(java.lang.String s)
                                   throws java.lang.IllegalArgumentException
Parameters:
s - string representation of this descriptor
Returns:
the canonical representative for this descriptor value
Throws:
java.lang.IllegalArgumentException

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toUnicodeString

public java.lang.String toUnicodeString()
Returns:
a unicode string representation of this descriptor

getReturnType

public TypeName getReturnType()
Returns:
the name of the return type of this descriptor

getParameters

public TypeName[] getParameters()
Returns:
the type names for the parameters in this descriptor

getNumberOfParameters

public int getNumberOfParameters()
Returns:
number of parameters in this descriptor