}
public Bindings process(final Triple triple, final boolean failOnBlank,
final int id) {
final Bindings bindings = this.bindingsFactory.createInstance();
Literal literal = null;
// process all items of this triple pattern
for (int i = 0; i < 3; i++) {
if (this.bloomFilters != null) {
if (this.bloomFilters[i] != null) {
if (!this.bloomFilters[i]
.get((Math.abs(triple.getPos(i).hashCode()) % SIPFilterOperator.NUMBEROFBITSFORBLOOMFILTER))) {
return null;
}
}
}
// if the triple's node at the current position is a blank
// one which is not allowed due to the current configuration
// return null to indicate this problem
if (failOnBlank && triple.getPos(i).isBlank()) {
return null;
}
// if the item is a variable
if (this.items[i].isVariable()) {
// if the item is an unbound variable
final Variable item = triple.getVariable((Variable) this.items[i]);
if ((literal = bindings.get(item)) == null) {
bindings.add(item, triple.getPos(i));
}
// if the item is a variable which is already bound
// and the value differs from the value of the triple
// which would be used as binding, a conflict was
// detected
else if (!literal.valueEquals(triple.getPos(i))) {
return null; // join within triple pattern!
}
}
// if the item is no variable ...
else {
// its value has to be equal to the corresponding value of
// the triple pattern
try {
if (!this.items[i].getLiteral(null)
.valueEquals(triple.getPos(i))) {
return null;
}
} catch (final Exception e) {
System.out.println(e);
e.printStackTrace();
return null;
}
}
}
bindings.addTriple(triple);
if (this.projectionPresortingNumbers != null) {
if (this.order1 == null) {
final int i = 0;
for (final BasicOperator bo : this.projectionPresortingNumbers.keySet()) {
final LinkedList<Variable> li = this.projectionPresortingNumbers.get(bo);
// else if (triple instanceof SortedTripleElement) {
// final Object o =
// lupos.engine.operators.index.mergeJoin.MergeJoinIndex
// .getSortPatterns4OptimizedJoin(this,
// projectionPresortingNumbers);
// bindings
// .addPresortingNumber(
// this,
// o,
// ((SortedTripleElement) triple)
// .getPosition((SortedTripleElement.ORDER_PATTERN) o),
// ((SortedTripleElement) triple).getMax());
// }
}
// System.out.println(this);
// System.out.println("order1, size " + order1.length + ":");
// for (int j = 0; j < order1.length; j++) {
// System.out.print(order1[j] + ", ");
// }
// System.out.println();
}
} else if (bindings instanceof BindingsArrayVarMinMax
&& this.minMaxPresortingNumbers != null) {
// this can only be reached for --optimization
// MergeJoinSortLazyLiteral --codemap LazyLiteral
final Map<Variable, Integer> hmvi = this.bindingsFactory.getPosVariables();
for (final Variable v : bindings.getVariableSet()) {
final Container container = this.minMaxPresortingNumbers.get(hmvi
.get(v));
if (container != null) {
((BindingsArrayVarMinMax) bindings).addMinMax(v,
container.min, container.max);