Class RegularEnumSetExtractor
java.lang.Object
org.eclipse.mat.internal.collectionextract.FieldArrayCollectionExtractor
org.eclipse.mat.internal.collectionextract.FieldSizeArrayCollectionExtractor
org.eclipse.mat.internal.collectionextract.RegularEnumSetExtractor
- All Implemented Interfaces:
ICollectionExtractor,IMapExtractor
public class RegularEnumSetExtractor
extends FieldSizeArrayCollectionExtractor
implements IMapExtractor
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.mat.inspections.collectionextract.IMapExtractor
IMapExtractor.EntryObject -
Constructor Summary
ConstructorsConstructorDescriptionRegularEnumSetExtractor(String sizeField, String arrayField) For java.util.RegularEnumSet -
Method Summary
Modifier and TypeMethodDescriptionint[]extractEntryIds(IObject coll) Returns the object ids (int) for all objects which are contained in the collectionextractMapEntries(IObject collection) Extracts the contents of a map (i.e.getCollisionRatio(IObject collection) Calculates the collision ratio in the collection.Extract the size of the collection.booleanCheck if the extractor can calculate collision ratioMethods inherited from class org.eclipse.mat.internal.collectionextract.FieldSizeArrayCollectionExtractor
hasSizeMethods inherited from class org.eclipse.mat.internal.collectionextract.FieldArrayCollectionExtractor
extractEntries, getCapacity, getFillRatio, getNumberOfNotNullElements, hasCapacity, hasExtractableArray, hasExtractableContents, hasFillRatioMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.mat.inspections.collectionextract.ICollectionExtractor
extractEntries, getCapacity, getFillRatio, getNumberOfNotNullElements, hasCapacity, hasExtractableArray, hasExtractableContents, hasFillRatio, hasSize
-
Constructor Details
-
RegularEnumSetExtractor
For java.util.RegularEnumSet- Parameters:
sizeField- - holds the bits indicating which set items are usedarrayField- - all the enum values
-
-
Method Details
-
getSize
Description copied from interface:ICollectionExtractorExtract the size of the collection.- Specified by:
getSizein interfaceICollectionExtractor- Overrides:
getSizein classFieldSizeArrayCollectionExtractor- 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:
-
extractEntryIds
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:
-
hasCollisionRatio
public boolean hasCollisionRatio()Description copied from interface:IMapExtractorCheck if the extractor can calculate collision ratio- Specified by:
hasCollisionRatioin interfaceIMapExtractor- Returns:
- true if @
IMapExtractor.getCollisionRatio(IObject)could be called - See Also:
-
getCollisionRatio
Description copied from interface:IMapExtractorCalculates the collision ratio in the collection. Could be an estimate.- Specified by:
getCollisionRatioin interfaceIMapExtractor- Parameters:
collection- - the collection to calculate the collision ratio of- Returns:
- Double number of elements with colliding keys / size
- Throws:
SnapshotException- See Also:
-
extractMapEntries
public Iterator<Map.Entry<IObject,IObject>> extractMapEntries(IObject collection) throws SnapshotException Description copied from interface:IMapExtractorExtracts the contents of a map (i.e. an IObject representing a Map) and provides an Iterator over them- Specified by:
extractMapEntriesin interfaceIMapExtractor- 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
-