|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.javasoft.lang.reflect.Array
public class Array
The Array class contains static methods to instantiate arrays
for generic types.
| Method Summary | ||
|---|---|---|
static
|
newInstance(Class<T> componentType,
int length)
Creates a new array of the given component type. |
|
static
|
newInstance(Class<T> componentType,
int rows,
int cols)
Creates a new array of the given component type. |
|
static
|
newInstanceInstantiate(Class<T> componentType,
int length)
Creates a new array of the given component type, and initializes the array with new instances by calling the default constructor of componentType |
|
static
|
newInstanceInstantiate(Class<T> componentType,
int rows,
int cols)
Creates a new array of the given component type, and initializes the array with new instances by calling the default constructor of componentType |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final <T> T[] newInstance(Class<T> componentType,
int length)
T - the component type generic parametercomponentType - the component type classlength - the length of the new array
public static final <T> T[][] newInstance(Class<T> componentType,
int rows,
int cols)
T - the component type generic parametercomponentType - the component type classrows - the length of the first dimension of the
new arraycols - the length of the second dimension of
the new array
public static final <T> T[] newInstanceInstantiate(Class<T> componentType,
int length)
throws InstantiationException,
IllegalAccessException
T - the component type generic parametercomponentType - the component type classlength - the length of the new array
InstantiationException - if calling the default constructor fails
IllegalAccessException - if calling the default constructor fails
public static final <T> T[][] newInstanceInstantiate(Class<T> componentType,
int rows,
int cols)
throws InstantiationException,
IllegalAccessException
T - the component type generic parametercomponentType - the component type classrows - the length of the first dimension of the
new arraycols - the length of the second dimension of
the new array
InstantiationException - if calling the default constructor fails
IllegalAccessException - if calling the default constructor fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||