[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [p2-dev] @noimplement and @noextend annotation of IQuery
- From: Thomas Hallgren <thomas@xxxxxxx>
- Date: Wed, 10 Mar 2010 09:03:49 +0100
- Delivered-to: firstname.lastname@example.org
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:188.8.131.52) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3
On 03/10/2010 06:36 AM, Meng Xin Zhu wrote:
A java service records some deselected IUs, the query should exclude
those IUs in that list.
You can use the function unique(). If given an argument that is a Set,
that Set is used as the discriminator.
Set<IInstallableUnit> recordedIUs = ...
Use a SimplePattern. A string like 'my.prefix.*' will match anything
starting with 'my.prefix.'
Another simpler case is querying the IUs whose id starts with specified
QueryUtil.createMatchQuery("id ~= $0", SimplePattern.parse(prefix + '*'));
For more advanced cases that really cannot be resolved only by use of a
query, there is often a benefit to start with a query anyway to benefit
from indexing and then perform additional filtering as a next step:
HashSet<IInstallableUnit> collector = new HashSet<IInstallableUnit>();
Iterator<IInstallableUnit> iter = queriable.query(<inital query>,
IInstallableUnit iu = iter.next();
So far, we have seen very few cases where this has been necessary.