Package org.eclipse.mat.snapshot.model

## Interface IPrimitiveArray

All Superinterfaces:
  `IArray`, `IObject`, `java.io.Serializable`

All Known Implementing Classes:
  `PrimitiveArrayImpl`

    public interface IPrimitiveArray
    extends IArray

Interface for primitive arrays in the heap dump.

No Implement:

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.eclipse.mat.snapshot.model.IObject

`IObject.Type`

### Field Summary

Fields
`static java.lang.Class<?>[]` `COMPONENT_TYPE` Java component type of the primitive array.
`static int[]` `ELEMENT_SIZE` Element sizes inside the array.
`static byte[]` `SIGNATURES` Primitive signatures.
`static java.lang.String[]` `TYPE` Display string of the type.

### Method Summary

All Methods Instance Methods Abstract Methods
`java.lang.Class<?>` `getComponentType()` Returns the component type of the array.
`int` `getType()` Returns the `IObject.Type` of the primitive array.
`java.lang.Object` `getValueArray()` Get the primitive Java array.
`java.lang.Object` `getValueArray​(int offset, int length)` Get the primitive Java array, beginning at `offset` and `length` number of elements.
`java.lang.Object` `getValueAt​(int index)` Returns the value of the array at the specified index

### 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, getOutboundReferences, getRetainedHeapSize, getSnapshot, getTechnicalName, getUsedHeapSize, resolveValue`

### Field Detail

#### SIGNATURES

    static final byte[] SIGNATURES

Primitive signatures. Indexes match the values of `IObject.Type`

See Also:
  `IObject.Type`

#### ELEMENT_SIZE

    static final int[] ELEMENT_SIZE

Element sizes inside the array. Indexes match the values of `IObject.Type`

See Also:
  `IObject.Type`

#### TYPE

    static final java.lang.String[] TYPE

Display string of the type. Indexes match the values of `IObject.Type`

See Also:
  `IObject.Type`

#### COMPONENT_TYPE

    static final java.lang.Class<?>[] COMPONENT_TYPE

Java component type of the primitive array. Indexes match the values of `IObject.Type`

See Also:
  `IObject.Type`

### Method Detail

#### getType

    int getType()

Returns the `IObject.Type` of the primitive array.

Returns:
  the type

#### getComponentType

    java.lang.Class<?> getComponentType()

Returns the component type of the array.

Returns:
  the Java class of the component type

#### getValueAt

    java.lang.Object getValueAt​(int index)

Returns the value of the array at the specified index

Parameters:
  `index` - from 0 to length-1
Returns:
  Byte - for a byte array Short - for a short array Integer - for an int array Long - for a long array Boolean - for a boolean array Char - for a char array Float - for a float array Double - for a double array

#### getValueArray

    java.lang.Object getValueArray()

Get the primitive Java array. The return value can be cast into the correct component type, e.g.

     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.

Returns:
  the contents of the primitive array

#### getValueArray

    java.lang.Object getValueArray​(int offset,
                                   int length)

Get the primitive Java array, beginning at `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.

Parameters:
  `offset` - the starting index
  `length` - the number of entries
Returns:
  the contents of the primitive array starting at the index for length entries