Eclipse Platform
Release 3.6

org.eclipse.equinox.p2.query
Class CompoundQueryable<T>

java.lang.Object
  extended by org.eclipse.equinox.p2.query.CompoundQueryable<T>
All Implemented Interfaces:
org.eclipse.equinox.p2.metadata.index.IIndexProvider<T>, IQueryable<T>

public class CompoundQueryable<T>
extends Object
implements IQueryable<T>, org.eclipse.equinox.p2.metadata.index.IIndexProvider<T>

A queryable that holds a number of other IQueryables and provides a mechanism for querying the entire set.

Since:
2.0

Constructor Summary
CompoundQueryable(Collection<? extends IQueryable<T>> queryables)
          Creates a queryable that combines the given collection of input queryables
CompoundQueryable(IQueryable<T> query1, IQueryable<T> query2)
          Creates a queryable that combines the two provided input queryables
CompoundQueryable(IQueryable<T> query1, IQueryable<T> query2, IQueryable<T> query3)
          Creates a queryable that combines the three provided input queryables
 
Method Summary
 Iterator<T> everything()
          Return the iterator that delivers all rows that the target query should consider.
 org.eclipse.equinox.p2.metadata.index.IIndex<T> getIndex(String memberName)
          Return an index optimized for producing candidates based on values for a memberName that denotes a member of the index type.
 Object getManagedProperty(Object client, String memberName, Object key)
          Returns a property that this index manages on behalf of a client object.
 IQueryResult<T> query(IQuery<T> query, IProgressMonitor monitor)
          Performs a query, passing any objects that satisfy the query to the provided collector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundQueryable

public CompoundQueryable(Collection<? extends IQueryable<T>> queryables)
Creates a queryable that combines the given collection of input queryables

Parameters:
queryables - The collection of queryables to be combined

CompoundQueryable

public CompoundQueryable(IQueryable<T> query1,
                         IQueryable<T> query2)
Creates a queryable that combines the two provided input queryables

Parameters:
query1 - The first queryable
query2 - The second queryable

CompoundQueryable

public CompoundQueryable(IQueryable<T> query1,
                         IQueryable<T> query2,
                         IQueryable<T> query3)
Creates a queryable that combines the three provided input queryables

Parameters:
query1 - The first queryable
query2 - The second queryable
query3 - The third queryable
Method Detail

query

public IQueryResult<T> query(IQuery<T> query,
                             IProgressMonitor monitor)
Description copied from interface: IQueryable
Performs a query, passing any objects that satisfy the query to the provided collector.

This method is long-running; progress and cancellation are provided by the given progress monitor.

Specified by:
query in interface IQueryable<T>
Parameters:
query - The query to perform
monitor - a progress monitor, or null if progress reporting is not desired
Returns:
The collector argument

getIndex

public org.eclipse.equinox.p2.metadata.index.IIndex<T> getIndex(String memberName)
Description copied from interface: org.eclipse.equinox.p2.metadata.index.IIndexProvider
Return an index optimized for producing candidates based on values for a memberName that denotes a member of the index type.

Specified by:
getIndex in interface org.eclipse.equinox.p2.metadata.index.IIndexProvider<T>
Parameters:
memberName - A member of type T.
Returns:
An index or null if this provider does not support this index.

everything

public Iterator<T> everything()
Description copied from interface: org.eclipse.equinox.p2.metadata.index.IIndexProvider
Return the iterator that delivers all rows that the target query should consider. This is used when no index can be found for any possible member.

Specified by:
everything in interface org.eclipse.equinox.p2.metadata.index.IIndexProvider<T>
Returns:
An iterator. Possibly emtpy but never null.

getManagedProperty

public Object getManagedProperty(Object client,
                                 String memberName,
                                 Object key)
Description copied from interface: org.eclipse.equinox.p2.metadata.index.IIndexProvider
Returns a property that this index manages on behalf of a client object. Examples of this is the properties that a profile manages for installable units.

Specified by:
getManagedProperty in interface org.eclipse.equinox.p2.metadata.index.IIndexProvider<T>
Parameters:
client - The client for which the property is managed. Typically an IU.
memberName - The name of the managed properties, i.e. "profileProperties"
key - The property key
Returns:
The managed property value or null if no value could be found.

Eclipse Platform
Release 3.6

Guidelines for using Eclipse APIs.

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