Eclipse Platform
Release 3.6

org.eclipse.equinox.p2.metadata.query
Class ExpressionContextQuery<T>

java.lang.Object
  extended by org.eclipse.equinox.p2.metadata.query.ExpressionContextQuery<T>
All Implemented Interfaces:
org.eclipse.equinox.p2.metadata.index.IQueryWithIndex<T>, IQuery<T>
Direct Known Subclasses:
LimitQuery

public class ExpressionContextQuery<T>
extends Object
implements org.eclipse.equinox.p2.metadata.index.IQueryWithIndex<T>

A query that evaluates using an iterator as input and produces a new iterator.

Since:
2.0

Constructor Summary
ExpressionContextQuery(Class<? extends T> elementClass, IContextExpression<T> expression)
           
ExpressionContextQuery(Class<? extends T> elementClass, IExpression expression, Object... parameters)
           
ExpressionContextQuery(Class<? extends T> matchingClass, String expression, Object... parameters)
           
 
Method Summary
protected static
<T> IContextExpression<T>
createExpression(IQuery<T> query)
           
 Class<? extends T> getElementClass()
           
static
<T> Class<? extends T>
getElementClass(IQuery<T> query)
           
 IContextExpression<T> getExpression()
          Returns the IExpression backing this query of null if this is not an expression query.
 IQueryResult<T> perform(org.eclipse.equinox.p2.metadata.index.IIndexProvider<T> indexProvider)
          Evaluates the query using the indexProvider.
 IQueryResult<T> perform(Iterator<T> iterator)
          Evaluates the query for a specific input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionContextQuery

public ExpressionContextQuery(Class<? extends T> elementClass,
                              IExpression expression,
                              Object... parameters)

ExpressionContextQuery

public ExpressionContextQuery(Class<? extends T> elementClass,
                              IContextExpression<T> expression)

ExpressionContextQuery

public ExpressionContextQuery(Class<? extends T> matchingClass,
                              String expression,
                              Object... parameters)
Method Detail

getElementClass

public Class<? extends T> getElementClass()

perform

public IQueryResult<T> perform(org.eclipse.equinox.p2.metadata.index.IIndexProvider<T> indexProvider)
Description copied from interface: org.eclipse.equinox.p2.metadata.index.IQueryWithIndex
Evaluates the query using the indexProvider. The query is first analyzed for index candidates (typically expressions like id == <some value>) and if possible, indexes returned by IIndexProvider.getIndex(String) will be used in place of the iterator returned by IIndexProvider.everything().

Specified by:
perform in interface org.eclipse.equinox.p2.metadata.index.IQueryWithIndex<T>
Parameters:
indexProvider - The provider of the material to evaluate the query on
Returns:
The results of the query.

perform

public IQueryResult<T> perform(Iterator<T> iterator)
Description copied from interface: IQuery
Evaluates the query for a specific input.

Specified by:
perform in interface IQuery<T>
Parameters:
iterator - The elements for which to evaluate the query on
Returns:
The results of the query.

getExpression

public IContextExpression<T> getExpression()
Description copied from interface: IQuery
Returns the IExpression backing this query of null if this is not an expression query.

Specified by:
getExpression in interface IQuery<T>
Returns:
An expression or null.

getElementClass

public static <T> Class<? extends T> getElementClass(IQuery<T> query)

createExpression

protected static <T> IContextExpression<T> createExpression(IQuery<T> query)

Eclipse Platform
Release 3.6

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.