jparse
Interface Constructor

All Superinterfaces:
HasExceptions
All Known Implementing Classes:
CompiledConstructor, ConstrAST

public interface Constructor
extends HasExceptions

Information on a Java constructor.

Author:
Jerry James

Method Summary
 Constructor bestMatch(Constructor cons)
          Find the best match, given two matching constructors
 Type getDeclaringClass()
          Returns the Type object representing the class or interface that declares the constructor represented by this object.
 int getModifiers()
          Returns the Java language modifiers for the constructor represented by this object, as an integer.
 Type[] getParameterTypes()
          Returns an array of Type objects that represent the formal parameter types, in declaration order, of this constructor.
 boolean match(Type[] params, Type caller)
          Determines whether this constructor matches the parameters given by a caller
 
Methods inherited from interface jparse.HasExceptions
getExceptionTypes
 

Method Detail

getDeclaringClass

public Type getDeclaringClass()
Returns the Type object representing the class or interface that declares the constructor represented by this object.

Returns:
the Type of the declaring class

getModifiers

public int getModifiers()
Returns the Java language modifiers for the constructor represented by this object, as an integer. The Modifier class should be used to decode the modifiers.

Returns:
the modifiers for this constructor

getParameterTypes

public Type[] getParameterTypes()
Returns an array of Type objects that represent the formal parameter types, in declaration order, of this constructor. Returns an array of length 0 if the underlying constructor takes no parameters.

Returns:
the parameter types of this constructor

match

public boolean match(Type[] params,
                     Type caller)
Determines whether this constructor matches the parameters given by a caller

Parameters:
params - the types of the parameters to the constructor
caller - the type of the caller
Returns:
true if this constructor matches, false otherwise

bestMatch

public Constructor bestMatch(Constructor cons)
Find the best match, given two matching constructors

Parameters:
cons - the other constructor to compare
Returns:
either this or cons, depending on which matches best, or null if neither matches best