|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface Reflection.Constructor
This interface represents a run-time constructor obtained through reflection.
Here are few examples of utilization:
// Default constructor (fastList = new FastList())
Reflection.Constructor fastListConstructor
= Reflection.getInstance().getConstructor("javolution.util.FastList()");
Object fastList = fastListConstructor.newInstance();
// Constructor with arguments (fastMap = new FastMap(64))
Reflection.Constructor fastMapConstructor
= Reflection.getInstance().getConstructor("javolution.util.FastMap(int)");
Object fastMap = fastMapConstructor.newInstance(new Integer(64));
Method Summary | |
---|---|
Class[] |
getParameterTypes()
Returns an array of Class objects that represents
the formal parameter types, in declaration order of this constructor. |
Object |
newInstance()
Invokes this constructor with no argument. |
Object |
newInstance(Object... args)
Invokes this constructor with the specified arguments. |
Object |
newInstance(Object arg0)
Invokes this constructor with the specified single argument. |
Object |
newInstance(Object arg0,
Object arg1)
Invokes this constructor with the specified two arguments. |
Object |
newInstance(Object arg0,
Object arg1,
Object arg2)
Invokes this constructor with the specified three arguments. |
Method Detail |
---|
Class[] getParameterTypes()
Class
objects that represents
the formal parameter types, in declaration order of this constructor.
Object newInstance()
IllegalArgumentException
- if
this.getParametersTypes().length != 0
Object newInstance(Object arg0)
arg0
- the first argument.
IllegalArgumentException
- if
this.getParametersTypes().length != 1
Object newInstance(Object arg0, Object arg1)
arg0
- the first argument.arg1
- the second argument.
IllegalArgumentException
- if
this.getParametersTypes().length != 2
Object newInstance(Object arg0, Object arg1, Object arg2)
arg0
- the first argument.arg1
- the second argument.arg2
- the third argument.
IllegalArgumentException
- if
this.getParametersTypes().length != 3
Object newInstance(Object... args)
args
- the arguments.
IllegalArgumentException
- if
this.getParametersTypes().length != args.length
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |