Class TreeMapCollectionExtractor
- java.lang.Object
-
- org.eclipse.mat.internal.collectionextract.MapCollectionExtractorBase
-
- org.eclipse.mat.internal.collectionextract.TreeMapCollectionExtractor
-
- All Implemented Interfaces:
ICollectionExtractor,IMapExtractor
- Direct Known Subclasses:
TreeMapArrayCollectionExtractor
public class TreeMapCollectionExtractor extends MapCollectionExtractorBase
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.mat.inspections.collectionextract.IMapExtractor
IMapExtractor.EntryObject
-
-
Constructor Summary
Constructors Constructor Description TreeMapCollectionExtractor(java.lang.String sizeField, java.lang.String keyField, java.lang.String valueField)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IObjectArrayextractEntries(IObject coll)Extracts the array containing the collection contentint[]extractEntryIds(IObject treeMap)Returns the object ids (int) for all objects which are contained in the collectionjava.lang.DoublegetCollisionRatio(IObject collection)Calculates the collision ratio in the collection.java.lang.DoublegetFillRatio(IObject coll)Calculate the fill ratio of a collectionjava.lang.IntegergetNumberOfNotNullElements(IObject coll)Returns the number of non-null elements in the collection.java.lang.IntegergetSize(IObject coll)Extract the size of the collection.booleanhasCollisionRatio()Check if the extractor can calculate collision ratiobooleanhasExtractableArray()Return true if the collection array based and the array can be extracted from the heap dumpbooleanhasExtractableContents()Check if the collection has extractable contentsbooleanhasFillRatio()Check if fill ratio for the collection can be calculated, i.e.booleanhasSize()Check if the size of the collection can be extracted.-
Methods inherited from class org.eclipse.mat.internal.collectionextract.MapCollectionExtractorBase
extractMapEntries, getCapacity, hasCapacity
-
-
-
-
Method Detail
-
hasExtractableArray
public boolean hasExtractableArray()
Description copied from interface:ICollectionExtractorReturn 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:ICollectionExtractorExtracts 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()
-
hasExtractableContents
public boolean hasExtractableContents()
Description copied from interface:ICollectionExtractorCheck if the collection has extractable contents- Returns:
- true if
ICollectionExtractor.extractEntryIds(IObject)could be called - See Also:
ICollectionExtractor.extractEntryIds(IObject)
-
extractEntryIds
public int[] extractEntryIds(IObject treeMap) throws SnapshotException
Description copied from interface:ICollectionExtractorReturns the object ids (int) for all objects which are contained in the collection- Parameters:
treeMap- - 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()
-
hasSize
public boolean hasSize()
Description copied from interface:ICollectionExtractorCheck 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 java.lang.Integer getSize(IObject coll) throws SnapshotException
Description copied from interface:ICollectionExtractorExtract 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 java.lang.Integer getNumberOfNotNullElements(IObject coll) throws SnapshotException
Description copied from interface:ICollectionExtractorReturns the number of non-null elements in the collection. Requires hasExtractableContents or hasExtractableArray- Parameters:
coll- - 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()
-
hasCollisionRatio
public boolean hasCollisionRatio()
Description copied from interface:IMapExtractorCheck if the extractor can calculate collision ratio- Returns:
- true if @
IMapExtractor.getCollisionRatio(IObject)could be called - See Also:
IMapExtractor.getCollisionRatio(IObject)
-
getCollisionRatio
public java.lang.Double getCollisionRatio(IObject collection)
Description copied from interface:IMapExtractorCalculates 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
- See Also:
IMapExtractor.hasCollisionRatio()
-
hasFillRatio
public boolean hasFillRatio()
Description copied from interface:ICollectionExtractorCheck if fill ratio for the collection can be calculated, i.e. if it has some predefined capacity and actual size.- Returns:
- true if
ICollectionExtractor.getFillRatio(IObject)could be called - See Also:
ICollectionExtractor.getFillRatio(IObject)
-
getFillRatio
public java.lang.Double getFillRatio(IObject coll) throws SnapshotException
Description copied from interface:ICollectionExtractorCalculate the fill ratio of a collection- Parameters:
coll- - the collection to find the fill ratio of- Returns:
- the fill ratio, between 0.0 and 1.0, or null if unavailable
- Throws:
SnapshotException- if there is a problem retrieving data from the snapshot- See Also:
ICollectionExtractor.hasFillRatio()
-
-