Search in sources :

Example 1 with InternalIdEdges

use of com.b2international.snowowl.snomed.datastore.index.taxonomy.InternalIdEdges in project snow-owl by b2ihealthcare.

the class NormalFormRelationship method hasCommonExhaustiveSuperType.

private boolean hasCommonExhaustiveSuperType(final NormalFormRelationship other) {
    final InternalIdEdges inferredAncestors = reasonerTaxonomy.getInferredAncestors();
    final LongSet valueAncestors = inferredAncestors.getDestinations(getDestinationId(), false);
    final LongSet otherValueAncestors = inferredAncestors.getDestinations(other.getDestinationId(), false);
    final LongSet commonAncestors = LongSets.intersection(valueAncestors, otherValueAncestors);
    for (final LongIterator itr = commonAncestors.iterator(); itr.hasNext(); ) /* empty */
    {
        final long commonAncestor = itr.next();
        if (isExhaustive(commonAncestor)) {
            return true;
        }
    }
    return false;
}
Also used : InternalIdEdges(com.b2international.snowowl.snomed.datastore.index.taxonomy.InternalIdEdges) LongSet(com.b2international.collections.longs.LongSet) LongIterator(com.b2international.collections.longs.LongIterator)

Aggregations

LongIterator (com.b2international.collections.longs.LongIterator)1 LongSet (com.b2international.collections.longs.LongSet)1 InternalIdEdges (com.b2international.snowowl.snomed.datastore.index.taxonomy.InternalIdEdges)1