org.eclipse.mat.internal.collectionextract
Class HashSetCollectionExtractor

java.lang.Object
  extended by org.eclipse.mat.internal.collectionextract.HashSetCollectionExtractor
All Implemented Interfaces:
ICollectionExtractor, IMapExtractor

public class HashSetCollectionExtractor
extends Object
implements IMapExtractor


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.mat.inspections.collectionextract.IMapExtractor
IMapExtractor.EntryObject
 
Constructor Summary
HashSetCollectionExtractor(String array_attribute, String key_attribute)
           
HashSetCollectionExtractor(String size_attribute, String array_attribute, String key_attribute, String value_attribute)
           
 
Method Summary
 IObjectArray extractEntries(IObject coll)
          Extracts the array containing the collection content
 int[] extractEntryIds(IObject coll)
          Returns the object ids (int) for all objects which are contained in the collection
 Iterator<Map.Entry<IObject,IObject>> extractMapEntries(IObject coll)
          Extracts the contents of a map (i.e.
 Integer getCapacity(IObject coll)
          Return the capacity of the collection, if applicable
 Double getCollisionRatio(IObject coll)
          Calculates the collision ratio in the collection
 Double getFillRatio(IObject coll)
          Calculate the fill ration of a collection
 Integer getNumberOfNotNullElements(IObject coll)
          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 hasCollisionRatio()
          Check if the extractor can calculate collision ratio
 boolean hasExtractableArray()
          Return true if the collection array based and the array can be extracted from the heap dump
 boolean hasExtractableContents()
          Check if the collection has extractable contents
 boolean hasFillRatio()
          Check if fill ratio for the collection can be calculated, i.e.
 boolean hasSize()
          Check if the size of the collection can be extracted
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashSetCollectionExtractor

public HashSetCollectionExtractor(String array_attribute,
                                  String key_attribute)

HashSetCollectionExtractor

public HashSetCollectionExtractor(String size_attribute,
                                  String array_attribute,
                                  String key_attribute,
                                  String value_attribute)
Method Detail

hasSize

public boolean hasSize()
Description copied from interface: ICollectionExtractor
Check if the size of the collection can be extracted

Specified by:
hasSize in interface ICollectionExtractor
Returns:

getSize

public Integer getSize(IObject coll)
                throws SnapshotException
Description copied from interface: ICollectionExtractor
Extract the size of the collection

Specified by:
getSize in interface ICollectionExtractor
Returns:
Throws:
SnapshotException

hasCapacity

public boolean hasCapacity()
Description copied from interface: ICollectionExtractor
Check if the collection has capacity, e.g. ArrayList

Specified by:
hasCapacity in interface ICollectionExtractor
Returns:

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 interface ICollectionExtractor
Returns:
Throws:
SnapshotException

hasFillRatio

public boolean hasFillRatio()
Description copied from interface: ICollectionExtractor
Check if fill ratio for the collection can be calculated, i.e. if it has some predefined capacity and actual size

Specified by:
hasFillRatio in interface ICollectionExtractor
Returns:

getFillRatio

public Double getFillRatio(IObject coll)
                    throws SnapshotException
Description copied from interface: ICollectionExtractor
Calculate the fill ration of a collection

Specified by:
getFillRatio in interface ICollectionExtractor
Returns:
Throws:
SnapshotException

extractEntries

public IObjectArray extractEntries(IObject coll)
                            throws SnapshotException
Description copied from interface: ICollectionExtractor
Extracts the array containing the collection content

Specified by:
extractEntries in interface ICollectionExtractor
Returns:
Throws:
SnapshotException

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

Specified by:
hasExtractableArray in interface ICollectionExtractor
Returns:

hasExtractableContents

public boolean hasExtractableContents()
Description copied from interface: ICollectionExtractor
Check if the collection has extractable contents

Specified by:
hasExtractableContents in interface ICollectionExtractor
Returns:

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 interface ICollectionExtractor
Returns:
Throws:
SnapshotException

getNumberOfNotNullElements

public Integer getNumberOfNotNullElements(IObject coll)
                                   throws SnapshotException
Description copied from interface: ICollectionExtractor
Returns the number of non-null elements in the collection. Requires hasExtractableContents or hasExtractableArray

Specified by:
getNumberOfNotNullElements in interface ICollectionExtractor
Returns:
Throws:
SnapshotException

hasCollisionRatio

public boolean hasCollisionRatio()
Description copied from interface: IMapExtractor
Check if the extractor can calculate collision ratio

Specified by:
hasCollisionRatio in interface IMapExtractor
Returns:

getCollisionRatio

public Double getCollisionRatio(IObject coll)
                         throws SnapshotException
Description copied from interface: IMapExtractor
Calculates the collision ratio in the collection

Specified by:
getCollisionRatio in interface IMapExtractor
Returns:
Double number of elements with colliding keys / size
Throws:
SnapshotException

extractMapEntries

public Iterator<Map.Entry<IObject,IObject>> extractMapEntries(IObject coll)
                                                       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 interface IMapExtractor
Parameters:
coll - - 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