org.eclipse.mat.internal.collectionextract

## Class ExtractionUtils

- java.lang.Object
- - org.eclipse.mat.internal.collectionextract.ExtractionUtils

    public class ExtractionUtils
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`ExtractionUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static IInstance` `followOnlyNonArrayOutgoingReference(IObject obj)` Get the only non-array object field from the object.
`static IObject` `followOnlyOutgoingReferencesExceptLast(String field, IObject obj)` Walks the only non-array object field from the object, stopping at the second-last.
`static int` `getNumberOfNotNullArrayElements(int[] ids)`
`static int` `getNumberOfNotNullArrayElements(IObjectArray arrayObject)`
`static int` `getNumberOfNotNullArrayElements(long[] addresses)`
`static IObjectArray` `getOnlyArrayField(IObject obj)` Get the only array field from the object.
`static int[]` `referenceArrayToIds(ISnapshot snapshot, long[] referenceArray)`
`static JdkVersion` `resolveVersion(ISnapshot snapshot)`
`static Integer` `toInteger(Object i)`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ExtractionUtils

    public ExtractionUtils()

### Method Detail

#### toInteger

    public static Integer toInteger(Object i)

#### getNumberOfNotNullArrayElements

    public static int getNumberOfNotNullArrayElements(IObjectArray arrayObject)

#### getNumberOfNotNullArrayElements

    public static int getNumberOfNotNullArrayElements(long[] addresses)

#### getNumberOfNotNullArrayElements

    public static int getNumberOfNotNullArrayElements(int[] ids)

#### referenceArrayToIds

    public static int[] referenceArrayToIds(ISnapshot snapshot,
                                            long[] referenceArray)
                                     throws SnapshotException

Throws:
  `SnapshotException`

#### followOnlyNonArrayOutgoingReference

    public static IInstance followOnlyNonArrayOutgoingReference(IObject obj)
                                                         throws SnapshotException

Get the only non-array object field from the object. For example used for finding the HashMap from the HashSet

Parameters:
  `obj` -
Returns:
  null if no non-array, or duplicates found
Throws:
  `SnapshotException`

#### followOnlyOutgoingReferencesExceptLast

    public static IObject followOnlyOutgoingReferencesExceptLast(String field,
                                                                 IObject obj)
                                                          throws SnapshotException

Walks the only non-array object field from the object, stopping at the second-last.

Parameters:
  `obj` -
Returns:
  null if no non-array, or duplicates found
Throws:
  `SnapshotException`

#### getOnlyArrayField

    public static IObjectArray getOnlyArrayField(IObject obj)
                                          throws SnapshotException

Get the only array field from the object.

Parameters:
  `obj` -
Returns:
  null if no non-array, or duplicates found
Throws:
  `SnapshotException`

#### resolveVersion

    public static JdkVersion resolveVersion(ISnapshot snapshot)
                                     throws SnapshotException

Throws:
  `SnapshotException`