Package org.eclipse.mat.inspections.collectionextract

## Interface IMapExtractor

All Superinterfaces:
  `ICollectionExtractor`

All Known Implementing Classes:
  `ConcurrentHashMapCollectionExtractor`, `ConcurrentSkipListCollectionExtractor`, `ConcurrentSkipListSetCollectionExtractor`, `EmptyMapExtractor`, `FieldSizeArrayMapExtractor`, `FieldSizedCapacityMapExtractor`, `HashedMapCollectionExtractorBase`, `HashMapCollectionExtractor`, `HashSetCollectionExtractor`, `IdentityHashMapCollectionExtractor`, `KeySetCollectionExtractor`, `MapCollectionExtractorBase`, `RegularEnumSetExtractor`, `SetFromCollectionExtractor`, `SingletonMapExtractor`, `TreeMapArrayCollectionExtractor`, `TreeMapCollectionExtractor`, `TreeSetArrayCollectionExtractor`, `TreeSetCollectionExtractor`, `WrapperFieldMapExtractor`, `WrapperMapExtractor`, `WrapperSetFromMapExtractor`

    public interface IMapExtractor
    extends ICollectionExtractor

MapExtractors are used to extract from the heap dump the contents of an object which represents a map of a certain type. It knows the internal details of how the map contents are stored and if the collection has certain properties or not

Since:
  1.5

### Nested Class Summary

Nested Classes
`static class` `IMapExtractor.EntryObject`

### Method Summary

All Methods Instance Methods Abstract Methods
`Iterator<Map.Entry<IObject,​IObject>>` `extractMapEntries​(IObject collection)` Extracts the contents of a map (i.e.
`Double` `getCollisionRatio​(IObject collection)` Calculates the collision ratio in the collection.
`boolean` `hasCollisionRatio()` Check if the extractor can calculate collision ratio

### Methods inherited from interface org.eclipse.mat.inspections.collectionextract.ICollectionExtractor

`extractEntries, extractEntryIds, getCapacity, getFillRatio, getNumberOfNotNullElements, getSize, hasCapacity, hasExtractableArray, hasExtractableContents, hasFillRatio, hasSize`

### Method Detail

#### hasCollisionRatio

    boolean hasCollisionRatio()

Check if the extractor can calculate collision ratio

Returns:
  true if @`getCollisionRatio(IObject)` could be called
See Also:
  `getCollisionRatio(IObject)`

#### getCollisionRatio

    Double getCollisionRatio​(IObject collection)
                      throws SnapshotException

Calculates the collision ratio in the collection. Could be an estimate.

Parameters:
  `collection` - - the collection to calculate the collision ratio of
Returns:
  Double number of elements with colliding keys / size
Throws:
  `SnapshotException`
See Also:
  `hasCollisionRatio()`

#### extractMapEntries

    Iterator<Map.Entry<IObject,​IObject>> extractMapEntries​(IObject collection)
                                                          throws SnapshotException

Extracts the contents of a map (i.e. an IObject representing a Map) and provides an Iterator over them

Parameters:
  `collection` - - 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`