Top Description Constructors Methods
org.codehaus.groovy.runtime

public Class ArrayTypeUtils

extends Object
Class Inheritance

Utilities for handling array types

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
checkArrayType(Class<T> clazz)

Check whether the type passed in is array type.

public static int

Returns:

the dimension of array
dimension
(Class<T>
the type of array
clazz
)

Calculate the dimension of array

public static Class<T>

Returns:

the type of elements
elementType
(Class<T>
the type of array
clazz
)

Get the type of array elements

public static Class<T>

Returns:

the result array
elementType
(Class<T>
the type of array
clazz
,
int
the target dimension
dim
)

Get the type of array elements by the dimension

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ArrayTypeUtilsback to summary
public ArrayTypeUtils()

Method Detail

checkArrayTypeback to summary
private static void checkArrayType(Class<T> clazz)

Check whether the type passed in is array type. If the type is not array type, throw IllegalArgumentException.

dimensionback to summary
public static int dimension(Class<T> clazz)

Calculate the dimension of array

Parameters
clazz:Class<T>

the type of array

Returns:int

the dimension of array

elementTypeback to summary
public static Class<T> elementType(Class<T> clazz)

Get the type of array elements

Parameters
clazz:Class<T>

the type of array

Returns:Class<T>

the type of elements

elementTypeback to summary
public static Class<T> elementType(Class<T> clazz, int dim)

Get the type of array elements by the dimension

Parameters
clazz:Class<T>

the type of array

dim:int

the target dimension

Returns:Class<T>

the result array