use of org.openlca.core.database.ResultDao in project olca-modules by GreenDelta.
the class TechIndex method fillFrom.
private void fillFrom(IDatabase db, ProductSystem system) {
var systems = new ProductSystemDao(db).descriptorMap();
var processes = new ProcessDao(db).descriptorMap();
var results = new ResultDao(db).descriptorMap();
var flows = new FlowDao(db).descriptorMap();
for (var link : system.processLinks) {
RootDescriptor p = processes.get(link.providerId);
if (p == null) {
p = systems.get(link.providerId);
if (p == null) {
p = results.get(link.providerId);
}
}
if (p == null)
continue;
var flow = flows.get(link.flowId);
if (flow == null)
continue;
// the tech-index checks for duplicates of products and links
var provider = TechFlow.of(p, flow);
add(provider);
var exchange = new LongPair(link.processId, link.exchangeId);
putLink(exchange, provider);
}
}
Aggregations