org.eclipse.mat.internal.collectionextract
Class IdentityHashMapCollectionExtractor

java.lang.Object
  extended by org.eclipse.mat.internal.collectionextract.FieldArrayCollectionExtractor
      extended by org.eclipse.mat.internal.collectionextract.FieldSizeArrayCollectionExtractor
          extended by org.eclipse.mat.internal.collectionextract.IdentityHashMapCollectionExtractor
All Implemented Interfaces:
ICollectionExtractor, IMapExtractor

public class IdentityHashMapCollectionExtractor
extends FieldSizeArrayCollectionExtractor
implements IMapExtractor

Info for IdentityHashMaps These are stored as key/value pairs in an array


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.mat.inspections.collectionextract.IMapExtractor
IMapExtractor.EntryObject
 
Constructor Summary
IdentityHashMapCollectionExtractor(String sizeField, String arrayField)
           
 
Method Summary
 int[] extractEntryIds(IObject idMap)
          Returns the object ids (int) for all objects which are contained in the collection
 Iterator<Map.Entry<IObject,IObject>> extractMapEntries(IObject coll)
          Extracts the contents of a map (i.e.
 Integer getCapacity(IObject collection)
          Gets the capacity of the map.
 Double getCollisionRatio(IObject coll)
          Calculates the collision ratio in the collection
 Double getFillRatio(IObject coll)
          Calculate the fill ration of a collection
 boolean hasCollisionRatio()
          Check if the extractor can calculate collision ratio
 boolean hasExtractableContents()
          Check if the collection has extractable contents
 
Methods inherited from class org.eclipse.mat.internal.collectionextract.FieldSizeArrayCollectionExtractor
getSize, hasSize
 
Methods inherited from class org.eclipse.mat.internal.collectionextract.FieldArrayCollectionExtractor
extractEntries, getNumberOfNotNullElements, hasCapacity, hasExtractableArray, hasFillRatio
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.mat.inspections.collectionextract.ICollectionExtractor
extractEntries, getNumberOfNotNullElements, getSize, hasCapacity, hasExtractableArray, hasFillRatio, hasSize
 

Constructor Detail

IdentityHashMapCollectionExtractor

public IdentityHashMapCollectionExtractor(String sizeField,
                                          String arrayField)
Method Detail

getCapacity

public Integer getCapacity(IObject collection)
                    throws SnapshotException
Gets the capacity of the map. Needs two array elements for each entry.

Specified by:
getCapacity in interface ICollectionExtractor
Overrides:
getCapacity in class FieldArrayCollectionExtractor
Returns:
Throws:
SnapshotException

hasExtractableContents

public boolean hasExtractableContents()
Description copied from interface: ICollectionExtractor
Check if the collection has extractable contents

Specified by:
hasExtractableContents in interface ICollectionExtractor
Overrides:
hasExtractableContents in class FieldArrayCollectionExtractor
Returns:

extractEntryIds

public int[] extractEntryIds(IObject idMap)
                      throws SnapshotException
Description copied from interface: ICollectionExtractor
Returns the object ids (int) for all objects which are contained in the collection

Specified by:
extractEntryIds in interface ICollectionExtractor
Overrides:
extractEntryIds in class FieldArrayCollectionExtractor
Returns:
Throws:
SnapshotException

hasCollisionRatio

public boolean hasCollisionRatio()
Description copied from interface: IMapExtractor
Check if the extractor can calculate collision ratio

Specified by:
hasCollisionRatio in interface IMapExtractor
Returns:

getCollisionRatio

public Double getCollisionRatio(IObject coll)
                         throws SnapshotException
Description copied from interface: IMapExtractor
Calculates the collision ratio in the collection

Specified by:
getCollisionRatio in interface IMapExtractor
Returns:
Double number of elements with colliding keys / size
Throws:
SnapshotException

getFillRatio

public Double getFillRatio(IObject coll)
                    throws SnapshotException
Description copied from interface: ICollectionExtractor
Calculate the fill ration of a collection

Specified by:
getFillRatio in interface ICollectionExtractor
Overrides:
getFillRatio in class FieldArrayCollectionExtractor
Returns:
Throws:
SnapshotException

extractMapEntries

public Iterator<Map.Entry<IObject,IObject>> extractMapEntries(IObject coll)
                                                       throws SnapshotException
Description copied from interface: IMapExtractor
Extracts the contents of a map (i.e. an IObject representing a Map) and provides an Iterator over them

Specified by:
extractMapEntries in interface IMapExtractor
Parameters:
coll - - the map to extract contents from
Returns:
an Iterator over the entries. If the original Map had an Entry object, the content of the iterator would usually be EntryObject
Throws:
SnapshotException