}
private static Table buildTable(Map<Var, Set<NodeValue>> possibleValues) {
if (possibleValues.size() == 0)
return TableFactory.createEmpty();
Table table = TableFactory.create();
// Although each filter condition must apply for a row to be accepted
// they are actually independent since only one condition needs to fail
// for the filter to reject the row. Thus for each unique variable/value
// combination a single row must be produced
for (Var v : possibleValues.keySet()) {
for (NodeValue value : possibleValues.get(v)) {
BindingMap b = BindingFactory.create();
b.add(v, value.asNode());
table.addBinding(b);
}
}
return table;
}