|
J avolution v5.5 (J2SE 1.6+) | ||||||||
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 | |
---|---|
java.lang.Class[] |
getParameterTypes()
Returns an array of Class objects that represents
the formal parameter types, in declaration order of this constructor. |
java.lang.Object |
newInstance()
Invokes this constructor with no argument. |
java.lang.Object |
newInstance(java.lang.Object... args)
Invokes this constructor with the specified arguments. |
java.lang.Object |
newInstance(java.lang.Object arg0)
Invokes this constructor with the specified single argument. |
java.lang.Object |
newInstance(java.lang.Object arg0,
java.lang.Object arg1)
Invokes this constructor with the specified two arguments. |
java.lang.Object |
newInstance(java.lang.Object arg0,
java.lang.Object arg1,
java.lang.Object arg2)
Invokes this constructor with the specified three arguments. |
Method Detail |
---|
java.lang.Class[] getParameterTypes()
Class
objects that represents
the formal parameter types, in declaration order of this constructor.
java.lang.Object newInstance()
java.lang.IllegalArgumentException
- if
this.getParametersTypes().length != 0
java.lang.Object newInstance(java.lang.Object arg0)
arg0
- the first argument.
java.lang.IllegalArgumentException
- if
this.getParametersTypes().length != 1
java.lang.Object newInstance(java.lang.Object arg0, java.lang.Object arg1)
arg0
- the first argument.arg1
- the second argument.
java.lang.IllegalArgumentException
- if
this.getParametersTypes().length != 2
java.lang.Object newInstance(java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)
arg0
- the first argument.arg1
- the second argument.arg2
- the third argument.
java.lang.IllegalArgumentException
- if
this.getParametersTypes().length != 3
java.lang.Object newInstance(java.lang.Object... args)
args
- the arguments.
java.lang.IllegalArgumentException
- if
this.getParametersTypes().length != args.length
|
J avolution v5.5 (J2SE 1.6+) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |