blob: 1bab6cadec070c1fa4048d06e2c09d62a5a712f8 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009 Cloudsmith Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Cloudsmith Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ql;
/**
* An expression that yields a new collection consisting of all elements of the
* <code>collection</code> for which the <code>filter</code> yields <code>true</code>.
*/
public final class Flatten extends UnaryCollectionFilter {
public static final String OPERATOR = "flatten"; //$NON-NLS-1$
public Flatten(Expression collection) {
super(collection);
}
public Object evaluate(ExpressionContext context, VariableScope scope) {
return new FlattenIterator(operand.evaluateAsIterator(context, scope));
}
String getOperator() {
return OPERATOR;
}
}