@Override public void findModelUsages( Collection<SModel> scope, Set<SModelReference> modelReferences, Consumer<SModel> consumer, Consumer<SModel> processedConsumer) { MultiMap<SModel, SModelReference> candidates = findCandidates(scope, modelReferences, processedConsumer, key -> new ModelUse(key)); for (Entry<SModel, Collection<SModelReference>> candidate : candidates.entrySet()) { if (FindUsagesUtil.hasModelUsages(candidate.getKey(), candidate.getValue())) { consumer.consume(candidate.getKey()); } } }
@Override public void findInstances( Collection<SModel> scope, Set<SAbstractConcept> concepts, Consumer<SNode> consumer, Consumer<SModel> processedConsumer) { MultiMap<SModel, SAbstractConcept> candidates = findCandidates( scope, concepts, processedConsumer, key -> new ConceptInstance(MetaIdHelper.getConcept(key))); for (Entry<SModel, Collection<SAbstractConcept>> candidate : candidates.entrySet()) { FindUsagesUtil.collectInstances(candidate.getKey(), candidate.getValue(), consumer); } }