edu.neu.ccs.jpf
Class JPFBase.MethodSignature

java.lang.Object
  extended byedu.neu.ccs.jpf.JPFBase.MemberSignature
      extended byedu.neu.ccs.jpf.JPFBase.ParametrizedSignature
          extended byedu.neu.ccs.jpf.JPFBase.MethodSignature
Enclosing class:
JPFBase

private static class JPFBase.MethodSignature
extends JPFBase.ParametrizedSignature

Encapsulates a method signature.


Field Summary
protected  int modifiers
          Modifers for this member.
protected  String name
          Name of this member.
protected  String returnType
          Name of the return type for this method.
 
Constructor Summary
JPFBase.MethodSignature(String s)
          Constructs a new signature object representing the given text method signature.
 
Method Summary
protected  void addModifier(String token)
          Adds the modifier represented by the given keyword to the list of modifiers for this method.
protected  void addParameter(String type, String name)
          Adds an parameter to this object with the given name, whose type is named by the given String.
protected  String className(Class c)
          Returns the unqualified name of the given class.
 boolean equals(Method m)
          Returns true if this method signature is correct for the given method.
protected  void fromString(String s)
          Parses the given text method signature and sets member data for this object accordingly.
 String[] getParameterNames()
          Returns an array containing the names of the parameters.
 String[] getParameterTypes()
          Returns an array containing the types of the parameters.
protected  boolean isModifier(String token)
          Returns true if the given String equals a method modifier keyword, or false otherwise.
protected  String modifierString()
          Returns a String representation of the modifiers for this member.
protected  String parameterString()
          Returns a String representation of the parameters for this object.
 String toString()
          Returns a text method signature represented by this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

returnType

protected String returnType
Name of the return type for this method.


modifiers

protected int modifiers
Modifers for this member.


name

protected String name
Name of this member.

Constructor Detail

JPFBase.MethodSignature

public JPFBase.MethodSignature(String s)
                        throws JPTError
Constructs a new signature object representing the given text method signature.

Parameters:
s - text signature for this method
Throws:
JPTError - if the text signature is malformed
Method Detail

fromString

protected void fromString(String s)
                   throws JPTError
Parses the given text method signature and sets member data for this object accordingly.

Specified by:
fromString in class JPFBase.MemberSignature
Parameters:
s - text method signature to parse
Throws:
JPTError - if the text signature is malformed

toString

public String toString()
Returns a text method signature represented by this object.


equals

public boolean equals(Method m)
Returns true if this method signature is correct for the given method.

Parameters:
m - method with which to compare

addParameter

protected void addParameter(String type,
                            String name)
Adds an parameter to this object with the given name, whose type is named by the given String.

Parameters:
type - name of the type of the parameter
name - name of the parameter

getParameterTypes

public String[] getParameterTypes()
Returns an array containing the types of the parameters.


getParameterNames

public String[] getParameterNames()
Returns an array containing the names of the parameters.


parameterString

protected String parameterString()
Returns a String representation of the parameters for this object.


addModifier

protected void addModifier(String token)
Adds the modifier represented by the given keyword to the list of modifiers for this method. If the given text is not a modifier, no changes are made to the modifier list.

Parameters:
token - possible keyword for modifier to be added

isModifier

protected boolean isModifier(String token)
Returns true if the given String equals a method modifier keyword, or false otherwise.

Parameters:
token - possible method modifier keyword

className

protected String className(Class c)
Returns the unqualified name of the given class.

Parameters:
c - class from which to extract name

modifierString

protected String modifierString()
Returns a String representation of the modifiers for this member.