public class PrimitiveArrayImpl extends AbstractArrayImpl implements IPrimitiveArray
IObject.Type
COMPONENT_TYPE, ELEMENT_SIZE, SIGNATURES, TYPE
Constructor and Description |
---|
PrimitiveArrayImpl(int objectId,
long address,
ClassImpl classInstance,
int length,
int type)
Constructs a primitive array
|
Modifier and Type | Method and Description |
---|---|
static long |
doGetUsedHeapSize(ClassImpl clazz,
int length,
int type)
Calculates the size of a primitive array
|
Class<?> |
getComponentType()
Returns the component type of the array.
|
List<NamedReference> |
getOutboundReferences()
Get list of snapshot objects referenced from this snapshot object with
the name of the field over which it was referenced.
|
ArrayLong |
getReferences()
Gets the outbound references from this object, as addresses.
|
int |
getType()
Returns the
IObject.Type of the primitive array. |
long |
getUsedHeapSize()
Get used heap size of just this object.
|
Object |
getValueArray()
Get the primitive Java array.
|
Object |
getValueArray(int offset,
int length)
Get the primitive Java array, beginning at
offset and
length number of elements. |
Object |
getValueAt(int index)
Returns the value of the array at the specified index
|
getInfo, getLength, getTechnicalName, setInfo, setLength
equals, getClassAddress, getClassId, getClassSpecificName, getClazz, getComparatorForClassSpecificName, getComparatorForTechnicalName, getComparatorForUsedHeapSize, getDisplayName, getGCRootInfo, getObjectAddress, getObjectId, getRetainedHeapSize, getSnapshot, hashCode, resolveValue, setClassInstance, setObjectAddress, setObjectId, setSnapshot, toString
getClassSpecificName, getClazz, getDisplayName, getGCRootInfo, getObjectAddress, getObjectId, getRetainedHeapSize, getSnapshot, getTechnicalName, resolveValue
public PrimitiveArrayImpl(int objectId, long address, ClassImpl classInstance, int length, int type)
objectId
- the id of the arrayaddress
- the address of the arrayclassInstance
- the type (class) of the arraylength
- the length in elementstype
- the actual type IObject.Type
public int getType()
IPrimitiveArray
IObject.Type
of the primitive array.getType
in interface IPrimitiveArray
public Class<?> getComponentType()
IPrimitiveArray
getComponentType
in interface IPrimitiveArray
public Object getValueAt(int index)
IPrimitiveArray
getValueAt
in interface IPrimitiveArray
index
- from 0 to length-1public Object getValueArray()
IPrimitiveArray
if (char.class == array.getComponentType()) { char[] content = (char[]) array.getValueArray(); System.out.println(content.length); }The return value must not be modified because it is cached by the heap dump adapter. This method does not return a copy of the array for performance reasons.
getValueArray
in interface IPrimitiveArray
public Object getValueArray(int offset, int length)
IPrimitiveArray
offset
and
length
number of elements.
The return value must not be modified because it is cached by the heap dump adapter. This method does not return a copy of the array for performance reasons.
getValueArray
in interface IPrimitiveArray
public ArrayLong getReferences()
AbstractObjectImpl
getReferences
in class AbstractObjectImpl
public List<NamedReference> getOutboundReferences()
IObject
getOutboundReferences
in interface IObject
public long getUsedHeapSize()
IObject
getUsedHeapSize
in interface IObject
getUsedHeapSize
in class AbstractObjectImpl
public static long doGetUsedHeapSize(ClassImpl clazz, int length, int type)
clazz
- the typelength
- the length in elementstype
- the actual type IObject.Type