org.eclipse.mat.parser
Interface IObjectReader

All Known Implementing Classes:
DTFJHeapObjectReader, HprofHeapObjectReader

public interface IObjectReader

Part of the parser which retrieves detailed information about an object


Method Summary
 void close()
          tidy up when snapshot no longer required
<A> A
getAddon(java.lang.Class<A> addon)
          Get additional information about the snapshot
 void open(ISnapshot snapshot)
          Open the dump file associated with the snapshot
 IObject read(int objectId, ISnapshot snapshot)
          Get detailed information about an object
 long[] readObjectArrayContent(ObjectArrayImpl array, int offset, int length)
          Get detailed information about a object array
 java.lang.Object readPrimitiveArrayContent(PrimitiveArrayImpl array, int offset, int length)
          Get detailed information about a primitive array
 

Method Detail

open

void open(ISnapshot snapshot)
          throws SnapshotException,
                 java.io.IOException
Open the dump file associated with the snapshot

Parameters:
snapshot -
Throws:
SnapshotException
java.io.IOException

read

IObject read(int objectId,
             ISnapshot snapshot)
             throws SnapshotException,
                    java.io.IOException
Get detailed information about an object

Parameters:
objectId - the object id
snapshot - the snapshot
Returns:
an IObject such as InstanceImpl, ObjectArrayImpl, PrimitiveArrayImpl, ClassLoaderImpl
Throws:
SnapshotException
java.io.IOException

readPrimitiveArrayContent

java.lang.Object readPrimitiveArrayContent(PrimitiveArrayImpl array,
                                           int offset,
                                           int length)
                                           throws java.io.IOException,
                                                  SnapshotException
Get detailed information about a primitive array

Parameters:
array - the array
offset - where in the array to start
length - how much to read
Returns:
a byte[], short[], int[], long[], boolean[], char[], float[], double[]
Throws:
java.io.IOException
SnapshotException

readObjectArrayContent

long[] readObjectArrayContent(ObjectArrayImpl array,
                              int offset,
                              int length)
                              throws java.io.IOException,
                                     SnapshotException
Get detailed information about a object array

Parameters:
array -
offset - where in the array to start
length - how much to read
Returns:
an array of object addresses, with 0 for nulls
Throws:
java.io.IOException
SnapshotException

getAddon

<A> A getAddon(java.lang.Class<A> addon)
           throws SnapshotException
Get additional information about the snapshot

Parameters:
addon - type of the additional information
Returns:
the additional information
Throws:
SnapshotException

close

void close()
           throws java.io.IOException
tidy up when snapshot no longer required

Throws:
java.io.IOException