// Determine if this constraint is indexable
if ( (!disableIndexing) && conf.isIndexLeftBetaMemory() && conf.isIndexRightBetaMemory() && isIndexable( constraints[i] ) && ( this.indexed < depth-1 ) ) {
if ( depth >= 1 && this.indexed == -1 ) {
// first index, so just add to the front
this.constraints.insertAfter( null,
new LinkedListEntry( constraints[i] ) );
this.indexed++;
} else {
// insert this index after the previous index
this.constraints.insertAfter( findNode( this.indexed++ ),
new LinkedListEntry( constraints[i] ) );
}
} else {
// not indexed, so just add to the end
this.constraints.add( new LinkedListEntry( constraints[i] ) );
}
}
// Now create the ContextEntries in the same order the constraints
for ( LinkedListEntry entry = (LinkedListEntry) this.constraints.getFirst(); entry != null; entry = (LinkedListEntry) entry.getNext() ) {