APIdia Launch Partner
Top Description Methods
com.sun.jdi

public Interface ArrayType

extends ReferenceType
Known Direct Implementers
com.sun.tools.jdi.ArrayTypeImpl

Provides access to the class of an array and the type of its components in the target VM.
Authors
Robert Field, Gordon Hirsch, James McIlree
Since
1.3
See Also
ArrayReference

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

a string containing the JNI signature of array components.
componentSignature
()

Gets the JNI signature of the components of this array class.

public Type

Returns:

the Type of this array's components.
componentType
()

Returns the component type of this array, as specified in the array declaration.

public String

Returns:

a text representation of the component type.
componentTypeName
()

Returns a text representation of the component type of this array.

public ArrayReference

Returns:

the newly created ArrayReference mirroring the new object in the target VM.
newInstance
(int
the number of components in the new array
length
)

Creates a new instance of this array class in the target VM.

Inherited from com.sun.jdi.ReferenceType:
allFieldsallLineLocationsallLineLocationsallMethodsavailableStrataclassLoaderclassObjectconstantPoolconstantPoolCountdefaultStratumequalsfailedToInitializefieldByNamefieldsgenericSignaturegetValuegetValueshashCodeinstancesisAbstractisFinalisInitializedisPreparedisStaticisVerifiedlocationsOfLinelocationsOfLinemajorVersionmethodsmethodsByNamemethodsByNameminorVersionmodulenamenestedTypessourceDebugExtensionsourceNamesourceNamessourcePathsvisibleFieldsvisibleMethods

Method Detail

componentSignatureback to summary
public String componentSignature()

Gets the JNI signature of the components of this array class. The signature describes the declared type of the components. If the components are objects, their actual type in a particular run-time context may be a subclass of the declared class.

Returns:String

a string containing the JNI signature of array components.

componentTypeback to summary
public Type componentType() throws ClassNotLoadedException

Returns the component type of this array, as specified in the array declaration.

Note

The component type of a array will always be created or loaded before the array - see The Java Virtual Machine Specification, section 5.3.3 - Creating Array Classes. However, although the component type will be loaded it may not yet be prepared, in which case the type will be returned but attempts to perform some operations on the returned type (e.g. fields()) will throw a ClassNotPreparedException. Use ReferenceType#isPrepared() to determine if a reference type is prepared.

Returns:Type

the Type of this array's components.

See Also
Type, Field.type() - for usage examples
componentTypeNameback to summary
public String componentTypeName()

Returns a text representation of the component type of this array.

Returns:String

a text representation of the component type.

newInstanceback to summary
public ArrayReference newInstance(int length)

Creates a new instance of this array class in the target VM. The array is created with the given length and each component is initialized to is standard default value.

Parameters
length:int

the number of components in the new array

Returns:ArrayReference

the newly created ArrayReference mirroring the new object in the target VM.

Exceptions
VMCannotBeModifiedException:
if the VirtualMachine is read-only - see VirtualMachine#canBeModified().