Class WrapperMapExtractor
- java.lang.Object
-
- org.eclipse.mat.internal.collectionextract.WrapperCollectionExtractor
-
- org.eclipse.mat.internal.collectionextract.WrapperMapExtractor
-
- All Implemented Interfaces:
ICollectionExtractor
,IMapExtractor
- Direct Known Subclasses:
KeySetCollectionExtractor
,WrapperFieldMapExtractor
public class WrapperMapExtractor extends WrapperCollectionExtractor implements IMapExtractor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.mat.inspections.collectionextract.IMapExtractor
IMapExtractor.EntryObject
-
-
Constructor Summary
Constructors Constructor Description WrapperMapExtractor(String field)
WrapperMapExtractor(String field, ICollectionExtractor extractor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<Map.Entry<IObject,IObject>>
extractMapEntries(IObject coll)
Extracts the contents of a map (i.e.Double
getCollisionRatio(IObject coll)
Calculates the collision ratio in the collection.boolean
hasCollisionRatio()
Check if the extractor can calculate collision ratio-
Methods inherited from class org.eclipse.mat.internal.collectionextract.WrapperCollectionExtractor
extractEntries, extractEntryIds, getCapacity, getFillRatio, getNumberOfNotNullElements, getSize, hasCapacity, hasExtractableArray, hasExtractableContents, hasFillRatio, hasSize
-
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, extractEntryIds, getCapacity, getFillRatio, getNumberOfNotNullElements, getSize, hasCapacity, hasExtractableArray, hasExtractableContents, hasFillRatio, hasSize
-
-
-
-
Constructor Detail
-
WrapperMapExtractor
public WrapperMapExtractor(String field)
-
WrapperMapExtractor
public WrapperMapExtractor(String field, ICollectionExtractor extractor)
-
-
Method Detail
-
hasCollisionRatio
public boolean hasCollisionRatio()
Description copied from interface:IMapExtractor
Check if the extractor can calculate collision ratio- Specified by:
hasCollisionRatio
in interfaceIMapExtractor
- Returns:
- true if @
IMapExtractor.getCollisionRatio(IObject)
could be called - See Also:
IMapExtractor.getCollisionRatio(IObject)
-
getCollisionRatio
public Double getCollisionRatio(IObject coll) throws SnapshotException
Description copied from interface:IMapExtractor
Calculates the collision ratio in the collection. Could be an estimate.- Specified by:
getCollisionRatio
in interfaceIMapExtractor
- Parameters:
coll
- - the collection to calculate the collision ratio of- Returns:
- Double number of elements with colliding keys / size
- Throws:
SnapshotException
- See Also:
IMapExtractor.hasCollisionRatio()
-
extractMapEntries
public Iterator<Map.Entry<IObject,IObject>> extractMapEntries(IObject coll)
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 interfaceIMapExtractor
- 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
-
-