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
Constructors Constructor Description RegularEnumSetExtractor(java.lang.String sizeField, java.lang.String arrayField)
For java.util.RegularEnumSet
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]
extractEntryIds(IObject coll)
Returns the object ids (int) for all objects which are contained in the collectionjava.util.Iterator<java.util.Map.Entry<IObject,IObject>>
extractMapEntries(IObject collection)
Extracts the contents of a map (i.e.java.lang.Double
getCollisionRatio(IObject collection)
Calculates the collision ratio in the collection.java.lang.Integer
getSize(IObject coll)
Extract the size of the collection.boolean
hasCollisionRatio()
Check if the extractor can calculate collision ratio-
Methods inherited from class org.eclipse.mat.internal.collectionextract.FieldSizeArrayCollectionExtractor
hasSize
-
Methods inherited from class org.eclipse.mat.internal.collectionextract.FieldArrayCollectionExtractor
extractEntries, getCapacity, getFillRatio, getNumberOfNotNullElements, hasCapacity, hasExtractableArray, hasExtractableContents, hasFillRatio
-
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, getCapacity, getFillRatio, getNumberOfNotNullElements, hasCapacity, hasExtractableArray, hasExtractableContents, hasFillRatio, hasSize
-
-
-
-
Method Detail
-
getSize
public java.lang.Integer getSize(IObject coll) throws SnapshotException
Description copied from interface:ICollectionExtractor
Extract the size of the collection.- Specified by:
getSize
in interfaceICollectionExtractor
- Overrides:
getSize
in 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:
ICollectionExtractor.hasSize()
-
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- Specified by:
extractEntryIds
in interfaceICollectionExtractor
- Overrides:
extractEntryIds
in 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()
-
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 java.lang.Double getCollisionRatio(IObject collection) throws SnapshotException
Description copied from interface:IMapExtractor
Calculates the collision ratio in the collection. Could be an estimate.- Specified by:
getCollisionRatio
in interfaceIMapExtractor
- Parameters:
collection
- - 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 java.util.Iterator<java.util.Map.Entry<IObject,IObject>> extractMapEntries(IObject collection) throws SnapshotException
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:
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
-
-