- All Known Implementing Classes:
Compiler
,CompilerBase
- Enclosing class:
- Members
public static interface Members.Resolution
Resolution
defines a strategy how applicable
members for explicitly given arguments are determined and how
the most specific member of these is chosen.- Author:
- Ole Kniemeyer
-
Method Summary
Modifier and TypeMethodDescriptionboolean
allowsAmbiguousMembers
(Member first) Defines if ambiguous members are allowed.Type[]
Returns the argument types which are used inisApplicable(Member, Members.Applicability, Scope)
to determine the applicability.boolean
isApplicable
(Member m, Members.Applicability applOut, Scope scope) Checks whether a memberm
is applicable.boolean
isLessThan
(Member m1, Members.Applicability a1, Member m2, Members.Applicability a2, Scope scope) Checks whether an applicable memberm1
is less specific than another applicable memberm2
.
-
Method Details
-
allowsAmbiguousMembers
Defines if ambiguous members are allowed. If so, ambiguities between members do not cause an exception be thrown inMembers#find(Resolution)
; the first member is returned.- Parameters:
first
- the first member of a set of ambiguous members- Returns:
true
iff ambiguous members are allowed andfirst
shall be returned as the result of resolution
-
isApplicable
Checks whether a memberm
is applicable. The quality of applicability is stored inapplOut
by this method.- Parameters:
m
- a memberapplOut
- the quality of applicability is stored here by this methodscope
- scope in which the member is accessed- Returns:
true
iffm
is applicable
-
getArgumentTypes
Type[] getArgumentTypes()Returns the argument types which are used inisApplicable(Member, Members.Applicability, Scope)
to determine the applicability. This method is only invoked to generate an error message in case no applicable member was found.- Returns:
- argument types
-
isLessThan
boolean isLessThan(Member m1, Members.Applicability a1, Member m2, Members.Applicability a2, Scope scope) Checks whether an applicable memberm1
is less specific than another applicable memberm2
. The applicablities are the same instances which have been passed before toisApplicable(Member, Members.Applicability, Scope)
.- Parameters:
m1
- a membera1
-m1
's applicability as determined byisApplicable(Member, Members.Applicability, Scope)
m2
- another membera2
-m2
's applicability as determined byisApplicable(Member, Members.Applicability, Scope)
scope
- scope in which the member is accessed- Returns:
true
iffm1
is less specific thanm2
-