# Interface IQuery<T>

Type Parameters:
  `T` - The type of input object that this query accepts

All Known Subinterfaces:
  `IMatchQuery<T>, IQueryWithIndex<T>`

All Known Implementing Classes:
  `ArtifactDescriptorQuery, ArtifactKeyQuery, ExpressionMatchQuery, ExpressionQuery, IUProfilePropertyQuery, MatchQuery, OSGiBundleQuery, UserVisibleRootQuery`

public interface IQuery<T>
The root interface for all queries that can be performed on an `IQueryable`. A query is a piece of logic that selects some objects from a list of provided inputs using some established criteria.

Any given query must be stable - running the same query on the same inputs must return an equal query result each time the query is executed. Thus a client that has performed a query can freely cache the result as long as they know the query input has not changed.

Since:
  2.0
Restriction:
  This interface is not intended to be implemented directly by clients.
Restriction:
  This interface is not intended to be extended directly by clients.

## Method Summary

Modifier and Type
Method
Description
`IExpression`
`getExpression()`
Returns the IExpression backing this query or `null` if this is not an expression query.
`IQueryResult<T>`
`perform(Iterator<T> iterator)`
Evaluates the query for a specific input.

## Method Details

### perform

IQueryResult<T> perform(Iterator<T> iterator)
Evaluates the query for a specific input.

Parameters:
  `iterator` - The elements for which to evaluate the query on
Returns:
  The results of the query.

### getExpression

IExpression getExpression()
Returns the IExpression backing this query or `null` if this is not an expression query.

Returns:
  An expression or `null`.