se.l4.silo.search.query.AndQuery Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of silo-search-api Show documentation
Show all versions of silo-search-api Show documentation
API for Lucene-based querying for Silo.
The newest version!
package se.l4.silo.search.query;
import java.util.List;
import com.google.common.collect.Lists;
import se.l4.silo.search.QueryItem;
import se.l4.silo.search.QueryPart;
import se.l4.silo.search.QueryWithSubqueries;
public class AndQuery
extends AbstractQueryPart
implements QueryWithSubqueries, ReturnPath>
{
private final List items;
public AndQuery()
{
items = Lists.newArrayList();
}
@Override
public void addQuery(QueryItem item)
{
items.add(item);
}
@Override
public >> P query(P q)
{
q.parent(this, this);
return q;
}
@Override
public ReturnPath done()
{
receiver.addQuery(new QueryItem("and", items));
return parent;
}
}