Package org.eclipse.mat.query

# Interface IQuery

All Known Implementing Classes:
  `ArrayFillRatioQuery`, `ArraysBySizeQuery`, `BigDropsQuery`, `BiggestObjectsPieQuery`, `BundleRegistryQuery`, `ClassLoaderExplorerQuery`, `ClassReferrersQuery`, `CollectionFillRatioQuery`, `CollectionsBySizeQuery`, `CompareTablesQuery`, `ComparisonReport`, `ComponentReportQuery`, `CopyActions`, `CopyActions.Address`, `CopyActions.FQClassName`, `CopyActions.Value`, `CopyOQL`, `CustomizedRetainedSetQuery`, `DeltaHistogram`, `DominatorQuery`, `DuplicatedClassesQuery`, `ExportHprof`, `ExtractListValuesQuery`, `FinalizerInProcessingQuery`, `FinalizerQuery`, `FinalizerQueueQuery`, `FinalizerReferenceStatQuery`, `FinalizerThreadLocalsQuery`, `FinalizerThreadQuery`, `FindLeaksQuery`, `FindLeaksQuery2`, `FindStringsQuery`, `GCRootsQuery`, `GroupByValueQuery`, `HashEntriesQuery`, `HashSetValuesQuery`, `HeapDumpInfoQuery`, `HistogramQuery`, `ImmediateDominatorsQuery`, `LeakHunterQuery`, `LeakHunterQuery2`, `LeakingPlugins`, `MapCollisionRatioQuery`, `MultiplePath2GCRootsQuery`, `ObjectListQuery`, `OpenSourceFileQuery`, `OQLQuery`, `Path2GCRootsQuery`, `PhantomReferenceStatQuery`, `PrimitiveArraysWithAConstantValueQuery`, `ReferenceLeakQuery`, `ReferenceQuery`, `RetainedSetQuery`, `RunExternalTest`, `RunRegisterdReport`, `SaveValueAsQuery`, `ShowInDominatorQuery`, `SimpleComparison`, `SoftReferenceStatQuery`, `SystemPropertiesQuery`, `ThreadInfoQuery`, `ThreadOverviewQuery`, `ThreadStackQuery`, `TopComponentsReportQuery`, `TopConsumers2Query`, `TopConsumersQuery`, `UnreachableObjectsQuery`, `WasteInCharArraysQuery`, `WeakReferenceStatQuery`

public interface IQuery
Interface representing a query on the heap dump. Arguments can be injected into the query using public fields marked with the `Argument` annotation. Typical arguments for a `SnapshotQuery` are

- `ISnapshot`
- `IHeapObjectArgument` - some heap objects
- `IContextObject`
- `IContextObjectSet`
- `IObject` - a object from the heap
- int or int[] tagged with `Argument.Advice.HEAP_OBJECT`.
- `ArrayInt` - list of object ids
- a type returned by `ISnapshot.getSnapshotAddons(Class)`

Typical arguments to be supplied by the user of the query include

- `Pattern`
- boolean flags
- int parm
- File file optionally tagged with tagged with `Argument.Advice.DIRECTORY` or `Argument.Advice.SAVE`.
- enum - an enum

The implementation can be tagged with the following annotations to control the placement and help in the query menus.

- `Name`
- `Category`
- `CommandName`
- `Icon`
- `Help`
- `HelpUrl`
- `Menu`
- `Usage`

Implementations of this interface need to be registered using the `org.eclipse.mat.report.query` extension point.

## Method Summary

Modifier and Type
Method
Description
`IResult`
`execute(IProgressListener listener)`
The execute method is called after all arguments have been injected into the query instance.

## Method Details

### execute

IResult execute(IProgressListener listener) throws Exception
The execute method is called after all arguments have been injected into the query instance. Typical results are `TextResult`, `CompositeResult`, `SectionSpec` etc.

Parameters:
  `listener` - Monitor to report progress and check for cancellation.
Returns:
  The result of the query.
Throws:
  `Exception` - if something went wrong running the query