Class FieldSizedCapacityCollectionExtractor
- java.lang.Object
-
- org.eclipse.mat.internal.collectionextract.FieldArrayCollectionExtractor
-
- org.eclipse.mat.internal.collectionextract.FieldSizeArrayCollectionExtractor
-
- org.eclipse.mat.internal.collectionextract.FieldSizedCapacityCollectionExtractor
-
- All Implemented Interfaces:
ICollectionExtractor
- Direct Known Subclasses:
FieldSizedCapacityMapExtractor
public class FieldSizedCapacityCollectionExtractor extends FieldSizeArrayCollectionExtractor
-
-
Constructor Summary
Constructors Constructor Description FieldSizedCapacityCollectionExtractor(java.lang.String sizeField, java.lang.String arrayField)
-
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 coll)Returns the object ids (int) for all objects which are contained in the collectionIArraygetArray(IObject coll)java.lang.IntegergetCapacity(IObject coll)Return the capacity of the collection, if applicablejava.lang.IntegergetNumberOfNotNullElements(IObject collection)Returns the number of non-null elements in the collection.booleanhasCapacity()Check if the collection has capacity, e.g.booleanhasExtractableArray()Return true if the collection array based and the array can be extracted from the heap dumpbooleanhasExtractableContents()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
getFillRatio, hasFillRatio
-
-
-
-
Method Detail
-
hasCapacity
public boolean hasCapacity()
Description copied from interface:ICollectionExtractorCheck if the collection has capacity, e.g. ArrayList- Specified by:
hasCapacityin interfaceICollectionExtractor- Overrides:
hasCapacityin classFieldArrayCollectionExtractor- Returns:
- true if
ICollectionExtractor.getCapacity(IObject)could be called - See Also:
ICollectionExtractor.getCapacity(IObject)
-
getArray
public IArray getArray(IObject coll) throws SnapshotException
- Throws:
SnapshotException
-
getCapacity
public java.lang.Integer getCapacity(IObject coll) throws SnapshotException
Description copied from interface:ICollectionExtractorReturn the capacity of the collection, if applicable- Specified by:
getCapacityin interfaceICollectionExtractor- Overrides:
getCapacityin classFieldArrayCollectionExtractor- 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()
-
hasExtractableContents
public boolean hasExtractableContents()
Description copied from interface:ICollectionExtractorCheck if the collection has extractable contents- Specified by:
hasExtractableContentsin interfaceICollectionExtractor- Overrides:
hasExtractableContentsin classFieldArrayCollectionExtractor- Returns:
- true if
ICollectionExtractor.extractEntryIds(IObject)could be called - See Also:
ICollectionExtractor.extractEntryIds(IObject)
-
extractEntryIds
public int[] extractEntryIds(IObject coll) throws SnapshotException
Description copied from interface:ICollectionExtractorReturns the object ids (int) for all objects which are contained in the collection- Specified by:
extractEntryIdsin interfaceICollectionExtractor- Overrides:
extractEntryIdsin classFieldArrayCollectionExtractor- 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()
-
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- Specified by:
hasExtractableArrayin interfaceICollectionExtractor- Overrides:
hasExtractableArrayin classFieldArrayCollectionExtractor- 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- Specified by:
extractEntriesin interfaceICollectionExtractor- Overrides:
extractEntriesin classFieldArrayCollectionExtractor- 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()
-
getNumberOfNotNullElements
public java.lang.Integer getNumberOfNotNullElements(IObject collection) throws SnapshotException
Description copied from interface:ICollectionExtractorReturns the number of non-null elements in the collection. Requires hasExtractableContents or hasExtractableArray- Specified by:
getNumberOfNotNullElementsin interfaceICollectionExtractor- Overrides:
getNumberOfNotNullElementsin classFieldArrayCollectionExtractor- 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()
-
-