JMMF API
pre-release v0.8

fr.umlv.jmmf.reflect
Class MultiFactory

java.lang.Object
  |
  +--fr.umlv.jmmf.reflect.MultiFactory

public class MultiFactory
extends java.lang.Object

Factory class for multi-method implementation.

Version:
0.8.6
Author:
Remi Forax

Constructor Summary
MultiFactory(TypeModel model, MultiHook hook)
          Construct a multi-method factory with a type model and a hook.
 
Method Summary
 MultiMethod create(java.lang.Class clazz, java.lang.String name, int length)
          construct a multi-method by taking all method named name with argLength parameter(s) in class clazz.
 MultiMethod create(java.lang.Class clazz, java.lang.String name, int length, boolean onlyPublic)
          construct a multi-method by taking all method named name with argLength parameter(s) in class clazz.
static MultiFactory getDefaultFactory()
          return the default factory instance.
 MultiHook getHook()
          return the hook of the current multi-method factory.
 TypeModel getTypeModel()
          return the type model of all multi-methods created with this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiFactory

public MultiFactory(TypeModel model,
                    MultiHook hook)
Construct a multi-method factory with a type model and a hook. All multi-method created with this factory have the same type model and the same hook.
Parameters:
model - type model of all multi-method created with this factory.
hook - hook of all multi-method created with this factory, may be null if no hook is needed.
See Also:
getDefaultFactory()
Method Detail

getTypeModel

public TypeModel getTypeModel()
return the type model of all multi-methods created with this factory.

getHook

public MultiHook getHook()
return the hook of the current multi-method factory.

create

public MultiMethod create(java.lang.Class clazz,
                          java.lang.String name,
                          int length)
construct a multi-method by taking all method named name with argLength parameter(s) in class clazz.
Parameters:
clazz - class which owns the named methods.
name - name of the methods.
argLenth - number of parameters.
Throws:
java.lang.IllegalArgumentException - if the class clazz contains no method named name or all methods found don't have the same number of parameters.

create

public MultiMethod create(java.lang.Class clazz,
                          java.lang.String name,
                          int length,
                          boolean onlyPublic)
construct a multi-method by taking all method named name with argLength parameter(s) in class clazz.
Parameters:
clazz - class which owns the named methods.
name - name of the methods.
argLenth - number of parameters.
onlyPublic - true if only the public methods must be used.
Throws:
java.lang.IllegalArgumentException - if the class clazz contains no method named name or all methods found don't have the same number of parameters.

getDefaultFactory

public static MultiFactory getDefaultFactory()
return the default factory instance.

JMMF API
pre-release v0.8

Rémi Forax 1999,2000 Université de Marne la Vallée