Class HashMapCollectionExtractor
- java.lang.Object
-
- org.eclipse.mat.internal.collectionextract.MapCollectionExtractorBase
-
- org.eclipse.mat.internal.collectionextract.HashedMapCollectionExtractorBase
-
- org.eclipse.mat.internal.collectionextract.HashMapCollectionExtractor
-
- All Implemented Interfaces:
ICollectionExtractor
,IMapExtractor
public class HashMapCollectionExtractor extends HashedMapCollectionExtractorBase
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.mat.inspections.collectionextract.IMapExtractor
IMapExtractor.EntryObject
-
-
Constructor Summary
Constructors Constructor Description HashMapCollectionExtractor(String sizeField, String arrayField, String keyField, String valueField)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IObjectArray
extractEntries(IObject coll)
Extracts the array containing the collection contentint[]
extractEntryIds(IObject coll)
Returns the object ids (int) for all objects which are contained in the collectionIObjectArray
getBackingArray(IObject coll)
Integer
getCapacity(IObject coll)
Return the capacity of the collection, if applicableInteger
getNumberOfNotNullElements(IObject collection)
Returns the number of non-null elements in the collection.Integer
getSize(IObject coll)
Extract the size of the collection.boolean
hasCapacity()
Check if the collection has capacity, e.g.boolean
hasExtractableArray()
Return true if the collection array based and the array can be extracted from the heap dumpboolean
hasExtractableContents()
Check if the collection has extractable contentsboolean
hasSize()
Check if the size of the collection can be extracted.-
Methods inherited from class org.eclipse.mat.internal.collectionextract.HashedMapCollectionExtractorBase
getCollisionRatio, getFillRatio, hasCollisionRatio, hasFillRatio
-
Methods inherited from class org.eclipse.mat.internal.collectionextract.MapCollectionExtractorBase
extractMapEntries
-
-
-
-
Method Detail
-
hasExtractableContents
public boolean hasExtractableContents()
Description copied from interface:ICollectionExtractor
Check if the collection has extractable contents- Returns:
- true if
ICollectionExtractor.extractEntryIds(IObject)
could be called - See Also:
ICollectionExtractor.extractEntryIds(IObject)
-
hasExtractableArray
public boolean hasExtractableArray()
Description copied from interface:ICollectionExtractor
Return true if the collection array based and the array can be extracted from the heap dump- Returns:
- true if
ICollectionExtractor.extractEntries(IObject)
could be called - See Also:
ICollectionExtractor.extractEntries(IObject)
-
extractEntries
public IObjectArray extractEntries(IObject coll) throws SnapshotException
Description copied from interface:ICollectionExtractor
Extracts the array containing the collection content- Parameters:
coll
- - the collection to find the object array holding its contents- Returns:
- the backing array for the collection
- Throws:
SnapshotException
- if there is a problem retrieving data from the snapshot- See Also:
ICollectionExtractor.hasExtractableArray()
-
extractEntryIds
public int[] extractEntryIds(IObject coll) throws SnapshotException
Description copied from interface:ICollectionExtractor
Returns the object ids (int) for all objects which are contained in the collection- Parameters:
coll
- - the collection to find the objects it holds- Returns:
- an array of ints which are the object ids.
- Throws:
SnapshotException
- if there is a problem retrieving data from the snapshot- See Also:
ICollectionExtractor.hasExtractableContents()
-
hasCapacity
public boolean hasCapacity()
Description copied from interface:ICollectionExtractor
Check if the collection has capacity, e.g. ArrayList- Specified by:
hasCapacity
in interfaceICollectionExtractor
- Overrides:
hasCapacity
in classMapCollectionExtractorBase
- Returns:
- true if
ICollectionExtractor.getCapacity(IObject)
could be called - See Also:
ICollectionExtractor.getCapacity(IObject)
-
getCapacity
public Integer getCapacity(IObject coll) throws SnapshotException
Description copied from interface:ICollectionExtractor
Return the capacity of the collection, if applicable- Specified by:
getCapacity
in interfaceICollectionExtractor
- Overrides:
getCapacity
in classMapCollectionExtractorBase
- Parameters:
coll
- - the collection to find the capacity of- Returns:
- the capacity in bytes, or null if unavailable
- Throws:
SnapshotException
- if there is a problem retrieving data from the snapshot- See Also:
ICollectionExtractor.hasCapacity()
-
hasSize
public boolean hasSize()
Description copied from interface:ICollectionExtractor
Check if the size of the collection can be extracted.- Returns:
- true if
ICollectionExtractor.getSize(IObject)
could be called - See Also:
ICollectionExtractor.getSize(IObject)
-
getSize
public Integer getSize(IObject coll) throws SnapshotException
Description copied from interface:ICollectionExtractor
Extract the size of the collection.- Parameters:
coll
- - the collection to find the size of- Returns:
- the size, or null if not available
- Throws:
SnapshotException
- if there is a problem retrieving data from the snapshot- See Also:
ICollectionExtractor.hasSize()
-
getNumberOfNotNullElements
public Integer getNumberOfNotNullElements(IObject collection) throws SnapshotException
Description copied from interface:ICollectionExtractor
Returns the number of non-null elements in the collection. Requires hasExtractableContents or hasExtractableArray- Parameters:
collection
- - the collection to find the number of non-null content objects- Returns:
- the number of non-null elements, or null if not available
- Throws:
SnapshotException
- See Also:
ICollectionExtractor.hasExtractableContents()
,ICollectionExtractor.hasExtractableArray()
-
getBackingArray
public IObjectArray getBackingArray(IObject coll) throws SnapshotException
- Throws:
SnapshotException
-
-