org.eclipse.mat.parser.model
Class ObjectArrayImpl

java.lang.Object
  extended by org.eclipse.mat.parser.model.AbstractObjectImpl
      extended by org.eclipse.mat.parser.model.AbstractArrayImpl
          extended by org.eclipse.mat.parser.model.ObjectArrayImpl
All Implemented Interfaces:
Serializable, IArray, IObject, IObjectArray

public class ObjectArrayImpl
extends AbstractArrayImpl
implements IObjectArray

Implementation of a Java object array.

See Also:
Serialized Form
No Extend:

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.mat.snapshot.model.IObject
IObject.Type
 
Constructor Summary
ObjectArrayImpl(int objectId, long address, ClassImpl classInstance, int length)
          Constructs an array of objects.
 
Method Summary
static long doGetUsedHeapSize(ClassImpl clazz, int length)
          Calculates the size of an object 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.
 long[] getReferenceArray()
          Get an array with the object addresses.
 long[] getReferenceArray(int offset, int length)
          Get an array with the object addresses, beginning at offset and length number of elements.
 ArrayLong getReferences()
          Gets the outbound references from this object, as addresses.
 long getUsedHeapSize()
          Get used heap size of just this object.
 
Methods inherited from class org.eclipse.mat.parser.model.AbstractArrayImpl
getInfo, getLength, getTechnicalName, setInfo, setLength
 
Methods inherited from class org.eclipse.mat.parser.model.AbstractObjectImpl
equals, getClassAddress, getClassId, getClassSpecificName, getClazz, getComparatorForClassSpecificName, getComparatorForTechnicalName, getComparatorForUsedHeapSize, getDisplayName, getGCRootInfo, getObjectAddress, getObjectId, getRetainedHeapSize, getSnapshot, hashCode, resolveValue, setClassInstance, setObjectAddress, setObjectId, setSnapshot, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.mat.snapshot.model.IArray
getLength
 
Methods inherited from interface org.eclipse.mat.snapshot.model.IObject
getClassSpecificName, getClazz, getDisplayName, getGCRootInfo, getObjectAddress, getObjectId, getRetainedHeapSize, getSnapshot, getTechnicalName, resolveValue
 

Constructor Detail

ObjectArrayImpl

public ObjectArrayImpl(int objectId,
                       long address,
                       ClassImpl classInstance,
                       int length)
Constructs an array of objects.

Parameters:
objectId - the object id of the array
address - the actual address
classInstance - the type of the array
length - the length of the array in elements
Method Detail

getUsedHeapSize

public long getUsedHeapSize()
Description copied from interface: IObject
Get used heap size of just this object.

Specified by:
getUsedHeapSize in interface IObject
Specified by:
getUsedHeapSize in class AbstractObjectImpl
Returns:
used heap size of this object

doGetUsedHeapSize

public static long doGetUsedHeapSize(ClassImpl clazz,
                                     int length)
Calculates the size of an object array

Parameters:
clazz - the type
length - the length in elements
Returns:
the size in bytes
Since:
1.0

getReferenceArray

public long[] getReferenceArray()
Description copied from interface: IObjectArray
Get an array with the object addresses. 0 indicates null values in the array.

Specified by:
getReferenceArray in interface IObjectArray

getReferenceArray

public long[] getReferenceArray(int offset,
                                int length)
Description copied from interface: IObjectArray
Get an array with the object addresses, beginning at offset and length number of elements.

Specified by:
getReferenceArray in interface IObjectArray

getReferences

public ArrayLong getReferences()
Description copied from class: AbstractObjectImpl
Gets the outbound references from this object, as addresses.

Specified by:
getReferences in class AbstractObjectImpl
Returns:
a list of outbound references

getOutboundReferences

public List<NamedReference> getOutboundReferences()
Description copied from interface: IObject
Get list of snapshot objects referenced from this snapshot object with the name of the field over which it was referenced.

Specified by:
getOutboundReferences in interface IObject
Returns:
list of snapshot objects referenced from this snapshot object with the name of the field over which it was referenced