APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.constant

public final Class ArrayClassDescImpl

extends Object
implements ClassDesc
Class Inheritance
All Implemented Interfaces
java.lang.constant.ClassDesc, java.lang.invoke.TypeDescriptor.OfField, java.lang.invoke.TypeDescriptor, java.lang.constant.ConstantDesc
Imports
java.lang.constant.ClassDesc, java.lang.invoke.MethodHandles, jdk.internal.vm.annotation.Stable, sun.invoke.util.Wrapper

An array class descriptor. Restrictions:

Field Summary

Modifier and TypeField and Description
private String
private final ClassDesc
private final int

Constructor Summary

AccessConstructor and Description
private
ArrayClassDescImpl(ClassDesc elementType, int rank)

Method Summary

Modifier and TypeMethod and Description
public ClassDesc
arrayType()

Implements java.lang.constant.ClassDesc.arrayType.

Returns a ClassDesc for an array type whose component type is described by this ClassDesc.

public ClassDesc
arrayType(int rank)

Implements java.lang.constant.ClassDesc.arrayType.

Returns a ClassDesc for an array type of the specified rank, whose component type is described by this ClassDesc.

public ClassDesc
componentType()

Overrides default java.lang.constant.ClassDesc.componentType.

Returns the component type of this ClassDesc, if it describes an array type, or null otherwise.

private String
public String
descriptorString()

Implements java.lang.constant.ClassDesc.descriptorString.

Returns a field type descriptor string for this type

public String
displayName()

Implements java.lang.constant.ClassDesc.displayName.

Returns a human-readable name for this ClassDesc.

public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Implements java.lang.constant.ClassDesc.equals.

Compare the specified object with this descriptor for equality.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
isArray()

Overrides default java.lang.constant.ClassDesc.isArray.

Returns whether this ClassDesc describes an array type.

public static ArrayClassDescImpl
ofValidated(ClassDesc elementType, int rank)

public static ArrayClassDescImpl
public Class<?>
resolveConstantDesc(MethodHandles.Lookup lookup)

Implements java.lang.constant.ClassDesc.resolveConstantDesc.

Resolves this descriptor reflectively, emulating the resolution behavior of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

cachedDescriptorStringback to summary
private String cachedDescriptorString
Annotations
@Stable
elementTypeback to summary
private final ClassDesc elementType
rankback to summary
private final int rank

Constructor Detail

ArrayClassDescImplback to summary
private ArrayClassDescImpl(ClassDesc elementType, int rank)

Method Detail

arrayTypeback to summary
public ClassDesc arrayType()

Implements java.lang.constant.ClassDesc.arrayType.

Doc from java.lang.constant.ClassDesc.arrayType.

Returns a ClassDesc for an array type whose component type is described by this ClassDesc.

Annotations
@Override
arrayTypeback to summary
public ClassDesc arrayType(int rank)

Implements java.lang.constant.ClassDesc.arrayType.

Doc from java.lang.constant.ClassDesc.arrayType.

Returns a ClassDesc for an array type of the specified rank, whose component type is described by this ClassDesc.

Annotations
@Override
componentTypeback to summary
public ClassDesc componentType()

Overrides default java.lang.constant.ClassDesc.componentType.

Doc from java.lang.constant.ClassDesc.componentType.

Returns the component type of this ClassDesc, if it describes an array type, or null otherwise.

Annotations
@Override
computeDescriptorback to summary
private String computeDescriptor()
descriptorStringback to summary
public String descriptorString()

Implements java.lang.constant.ClassDesc.descriptorString.

Doc from java.lang.constant.ClassDesc.descriptorString.

Returns a field type descriptor string for this type

Annotations
@Override
displayNameback to summary
public String displayName()

Implements java.lang.constant.ClassDesc.displayName.

Doc from java.lang.constant.ClassDesc.displayName.

Returns a human-readable name for this ClassDesc. For primitive types, this method returns the simple name (such as int). For class or interface types, this method returns the unqualified class name. For array types, this method returns the human-readable name of the component type suffixed with the appropriate number of [] pairs.

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements java.lang.constant.ClassDesc.equals.

Doc from java.lang.constant.ClassDesc.equals.

Compare the specified object with this descriptor for equality. Returns true if and only if the specified object is also a ClassDesc and both describe the same type.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
isArrayback to summary
public boolean isArray()

Overrides default java.lang.constant.ClassDesc.isArray.

Doc from java.lang.constant.ClassDesc.isArray.

Returns whether this ClassDesc describes an array type.

Annotations
@Override
ofValidatedback to summary
public static ArrayClassDescImpl ofValidated(ClassDesc elementType, int rank)
ofValidatedDescriptorback to summary
public static ArrayClassDescImpl ofValidatedDescriptor(String desc)
resolveConstantDescback to summary
public Class<?> resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException

Implements java.lang.constant.ClassDesc.resolveConstantDesc.

Doc from java.lang.constant.ConstantDesc.resolveConstantDesc.

Resolves this descriptor reflectively, emulating the resolution behavior of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4. The resolution and access control context is provided by the MethodHandles.Lookup parameter. No caching of the resulting value is performed.

Annotations
@Override
Exceptions
ReflectiveOperationException:
if a class, method, or field could not be reflectively resolved in the course of resolution
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override