Java Utililty Methods Array Type Get

List of utility methods to do Array Type Get

  1. HOME
  2. Java
  3. A
  4. Array Type Get

Description

The list of methods to do Array Type Get are organized into topic(s).

Method

Class arrayBaseClass(Class c)
Gets the base component type of an array of arbitrary dimensions.
Class<?> result = c;
while (result.isArray()) {
 result = result.getComponentType();
return result;
Class arrayClass(Class klass)
array Class
Class<A[]> result;
try {
 result = (Class<A[]>) Class.forName("[" + klass.getName());
} catch (Exception e) {
 throw new RuntimeException(e);
return result;
Class arrayClass(Class compClass)
Return the array class that holds the specific component type.
ClassLoader loader = compClass.getClassLoader();
if (loader == null) {
 loader = Thread.currentThread().getContextClassLoader();
if (loader == null) {
 loader = ClassLoader.getSystemClassLoader();
if (loader == null) {
...
Class arrayComponentClassFromArray(T[] arg)
Helper method to create an arrayComponentType from the componentType of an array that's provided.
return (Class<T>) arg.getClass().getComponentType();
boolean arrayElementIsObjectType(Class clazz)
array Element Is Object Type
return isArray(clazz) && !isBasicClass(clazz.getComponentType());

AltStyle によって変換されたページ (->オリジナル) /