final FieldIndex[] indexes = (FieldIndex[]) list.toArray( new FieldIndex[list.size()] );
TupleMemory tupleMemory;
if ( config.isIndexLeftBetaMemory() ) {
tupleMemory = new TupleIndexHashTable( indexes );
} else {
tupleMemory = new TupleHashTable();
}
FactHandleMemory factHandleMemory;
if ( config.isIndexRightBetaMemory() ) {
factHandleMemory = new FactHandleIndexHashTable( indexes );
} else {
factHandleMemory = config.isSequential() ? (FactHandleMemory) new FactList() : (FactHandleMemory) new FactHashTable();
}
memory = new BetaMemory( config.isSequential() ? null : tupleMemory,
factHandleMemory );
} else {
memory = new BetaMemory( config.isSequential() ? null : new TupleHashTable(),
config.isSequential() ? (FactHandleMemory) new FactList() : (FactHandleMemory) new FactHashTable() );
}
return memory;
}