HAL Id: hal-00627863
https://hal.science/hal-00627863
Submitted on 29 Sep 2011
HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
A Simple Dispatch Technique for Pure Java Multi-Methods
Rémi Forax, Étienne Duris, Gilles Roussel
To cite this version:
Rémi Forax, Étienne Duris, Gilles Roussel. A Simple Dispatch Technique for Pure Java Multi- Methods. 2001. �hal-00627863�
CharacterData
EImpl CDImpl TImpl CImpl DImpl
Element Document
Node
CDATASection Text Comment
Implementation classes Document
Object Model interface specifications
int boolean
long float double
char
byte short T’
T
direct supertype of
primitive Interface
Class
Serializable Cloneable
Object
D [D
[B B
[Object I
K C
E F
J
L
Bis a supertype ofD
Object
J
D
B C K
I
m2 m3
m1
arg1arg2 arg3 T
The fact that T could be the type of ï the 2nd argument of m3 or is depicted by:
ï the 3rd argument of m1
and are not comparable
m1 m2
m2:(D,I,I) m1:(B,C,K)
more specific than m3
is
m1
m1:(B,C,K)
m3:(B,I,J) and
are not comparable
m2 m3
m2:(D,I,I)
m3:(B,I,J)
a b ? c
than specific m3 is less
m1 and m3 m1 and m3
than specific m1 is more
PO PO t
m2m1 m3
m1 m2 m3 m1 m2 m3
m1m2 m3
Object
B
D
I J
K L
C
Object
B
D
I J
K L
F C
E D
L K
B C
I J
F Object MaskM
myMethod(D d,I i1, I i2){ } myMethod(B b,C c,K k){ } myMethod(B b,I i,J j){ } }
class HostClass {
myMethod(D d,I i1,I i2){ } myMethod(D d,I i,J j){ } myMethod(C c,K k,E e){ } }
class SubHostClass extends HostClass {
PO
Dispatch tables