private IConceptSet getLeaves ( final IConceptSet concepts ) { // Deal with any equivalent concepts. If there are equivalent concepts in the set then we only keep one of them. // Otherwise, both will get eliminated from the final set. final IConceptSet filtered = filterEquivalents ( concepts ) ; final IConceptSet leafBs = IConceptSet . FACTORY . createConceptSet ( filtered ) ; final IConceptSet set = IConceptSet . FACTORY . createConceptSet ( leafBs ) ; for ( final IntIterator bItr = set . iterator ( ) ; bItr . hasNext ( ) ; ) { final int b = bItr . next ( ) ; final IConceptSet ancestors = IConceptSet . FACTORY . createConceptSet ( getAncestors ( no , b ) ) ; ancestors . remove ( b ) ; leafBs . removeAll ( ancestors ) ; } return leafBs ; }
Given a set of concepts computes the subset such that no member of the subset is subsumed by another member .