|
antlraux package v0.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlraux.context.types.CommonType | +--antlraux.context.types.DeclaredType | +--antlraux.context.types.MethodType
This is a basic implementation of MethodType
inferface.
Field Summary | |
protected Type |
classType
The class that holds the method |
protected java.util.LinkedList |
params
A list of parameter types |
protected Type |
returnType
The method's return type |
protected Scope |
scope
Stores the method's scope |
Fields inherited from class antlraux.context.types.DeclaredType |
modifiers |
Fields inherited from class antlraux.context.types.CommonType |
name, tag |
Fields inherited from interface antlraux.context.types.Type |
DEFAULT_NAME, DEFAULT_TAG |
Constructor Summary | |
MethodType(int tag,
java.lang.String typeName,
Type returnType,
ClassType classType,
Scope s)
|
Method Summary | |
void |
addParam(Type type)
|
void |
clearParams()
|
boolean |
compatibleParamLists(MethodType other)
Returns true if the two param lists are "compatible" (they have the same length, and every parameter type is compatible with its equivalent in the other list). |
boolean |
compatibleParams(Type myType,
Type hisType)
Returns true if both myType and hisType implement HeritableType , and hisType.isA(myType)
myType.equals(hisType) || hisType.equals(myType)
|
boolean |
compatibleWith(MethodType other)
|
boolean |
compatibleWith(MethodType other,
boolean compareName,
boolean compareReturnType,
boolean compareModifiers)
|
Type |
getClassType()
|
Type |
getReturnType()
|
Scope |
getScope()
Gets the type's scope |
java.util.Enumeration |
params()
|
void |
setClassType(Type classType)
|
void |
setReturnType(Type t)
|
void |
setScope(Scope s)
Sets the type's scope |
java.lang.String |
toString()
|
Methods inherited from class antlraux.context.types.DeclaredType |
addModifier, clearModifiers, compareModifiers, equals, hasModifier, modifiers, modifiersSet |
Methods inherited from class antlraux.context.types.CommonType |
getName, getTag, setName, setTag |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface antlraux.context.types.Type |
equals, getName, getTag, setName, setTag |
Field Detail |
protected Type returnType
protected java.util.LinkedList params
protected Type classType
protected Scope scope
Constructor Detail |
public MethodType(int tag, java.lang.String typeName, Type returnType, ClassType classType, Scope s)
Method Detail |
public Type getReturnType()
public void setReturnType(Type t)
public java.util.Enumeration params()
public void addParam(Type type)
public void clearParams()
public void setClassType(Type classType)
setClassType
in interface ClassMemberType
public Type getClassType()
getClassType
in interface ClassMemberType
public Scope getScope()
ScopedType
getScope
in interface ScopedType
public void setScope(Scope s)
ScopedType
setScope
in interface ScopedType
public boolean compatibleWith(MethodType other)
public boolean compatibleWith(MethodType other, boolean compareName, boolean compareReturnType, boolean compareModifiers)
public boolean compatibleParamLists(MethodType other)
compatibleParams(Type,Type)
(CompatibleParams(a,b)) returns true.
public boolean compatibleParams(Type myType, Type hisType)
HeritableType
, and hisType.isA(myType)
public java.lang.String toString()
toString
in interface Type
toString
in class DeclaredType
|
antlraux package v0.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |