|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IQLFactory
This inteface provides all the factory methods needed to create the all possible nodes of the expression tree.
Field Summary |
---|
Fields inherited from interface org.eclipse.equinox.p2.metadata.expression.IExpressionFactory |
---|
FUNC_BOOLEAN, FUNC_CLASS, FUNC_FILTER, FUNC_RANGE, FUNC_VERSION, NO_ARGS |
Method Summary | |
---|---|
IExpression |
array(IExpression... elements)
Create an array of elements. |
IExpression |
assignment(IExpression variable,
IExpression expression)
Creates an expression that represents a variable assignment |
IExpression |
collect(IExpression collection,
IExpression lambda)
Create an expression that collects the result of evaluating each element in a new collection. |
IExpression |
condition(IExpression test,
IExpression ifTrue,
IExpression ifFalse)
Create an expression that first evaluates a test and then, depending on the outcome,
evaluates either ifTrue or ifFalse . |
IExpression |
first(IExpression collection,
IExpression lambda)
Create an expression that yields the first element of the collection for which the lambda yields true . |
IExpression |
flatten(IExpression collection)
Intended to be applied on collections of collections. |
IExpression |
function(Object function,
IExpression... args)
Given one of the values in the map returned by getFunctionMap() , this method
returns a function expression. |
Map<String,? extends Object> |
getFunctionMap()
Returns a map of functions supported by this factory. |
IExpression |
lambda(IExpression variable,
IExpression[] initialAssignments,
IExpression body)
Creates a lambda expression that takes more then one variable (currying). |
IExpression |
memberCall(IExpression target,
String name,
IExpression... args)
Creates a member call expression. |
IExpression |
traverse(IExpression collection,
IExpression lambda)
Recursively traverse and collect elements based on a condition A common scenario in p2 is that you want to start with a set of roots and then find all items that fulfill the root requirements. |
IExpression |
unique(IExpression collection,
IExpression cache)
Create an expression that yields a new collection where each element is unique. |
Methods inherited from interface org.eclipse.equinox.p2.metadata.expression.IExpressionFactory |
---|
all, and, at, constant, contextExpression, createContext, createContext, equals, exists, filterExpression, greater, greaterEqual, indexedParameter, intersect, lambda, latest, less, lessEqual, limit, limit, matches, matchExpression, member, normalize, not, or, pipe, select, thisVariable, toExpression, union, variable |
Method Detail |
---|
IExpression array(IExpression... elements)
elements
- The elements of the array
IExpression assignment(IExpression variable, IExpression expression)
variable
- The variableexpression
- The expression that yields the value to assign to the variable
IExpression collect(IExpression collection, IExpression lambda)
collection
- The collection providing the elements to evaluatelambda
- The lambda that creates each new element
IExpression condition(IExpression test, IExpression ifTrue, IExpression ifFalse)
test
and then, depending on the outcome,
evaluates either ifTrue
or ifFalse
. The expression yields the result
of the ifTrue
or ifFalse
evaluation.
test
- The testifTrue
- The code to evaluate when the test evaluates to true
ifFalse
- The code to evaluate when the test evaluates to false
IExpression first(IExpression collection, IExpression lambda)
collection
for which the lambda
yields true
.
collection
- The collection providing the elements to testlambda
- The lambda that performs the test
IExpression flatten(IExpression collection)
collection
- The collection providing the collections that provides all elements
IExpression function(Object function, IExpression... args)
getFunctionMap()
, this method
returns a function expression.
function
- The value obtained from the map.args
- The arguments to evaluate and pass when evaluating the function.
Map<String,? extends Object> getFunctionMap()
function(Object, IExpression[])
method.
IExpression lambda(IExpression variable, IExpression[] initialAssignments, IExpression body)
variable
- The element variable that the lambda usesbody
- The body of the lambdainitialAssignments
- Assignments to evaluate once before calling the body for each element.
IExpression memberCall(IExpression target, String name, IExpression... args)
target
- The target for the member callname
- The name of the memberargs
- The arguments to use for the call
IExpression traverse(IExpression collection, IExpression lambda)
Recursively traverse and collect elements based on a condition
A common scenario in p2 is that you want to start with a set of roots and then find all items that fulfill the root requirements. Those items in turn introduce new requirements so you want to find them too. The process continues until no more requirements can be satisfied. This type of query can be performed using the traverse function.
The function will evaluate an expression, once for each element, collect elements for which the evaluation returned true, then then re-evaluate using the collected result as source of elements. No element is evaluated twice. This continues until no more elements are found.
collection
- The collection providing the elements to testlambda
- The lambda that collects the children for the next iteration
IExpression unique(IExpression collection, IExpression cache)
cache
can be provided if the uniqueness should span a larger
scope then just the source collection.
collection
- The source collectioncache
- Optional cache to use when uniqueness should span over several invocations
|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.