Package org.jetbrains.mps.util
Class BreadthConceptHierarchyIterator
- java.lang.Object
- 
- org.jetbrains.mps.util.BreadthConceptHierarchyIterator
 
- 
- All Implemented Interfaces:
- Iterable<SAbstractConcept>,- Iterator<SAbstractConcept>
 
 public class BreadthConceptHierarchyIterator extends Object implements Iterable<SAbstractConcept>, Iterator<SAbstractConcept> Iterates hierarchy of concepts, breadth-first. Iterator doesn't support removals. Return values are not unique, e.g. if an interface is implemented by few concepts, it is reported several times. Wrap withUniqueIteratorif necessary. Given ConceptA implements I1, I2 and ConceptB extends ConceptA implements I3, I4; Interface I3 extends I5; Interface I5 extends I1; and ConceptB as starting point, yields: { ConceptB, I3, I4 } - level 0 for ConceptB, { ConceptA, I1, I2 } - level 1 from ConceptA , { I5 } level 1 from I3, {I1} - level 2 from I5. Note, this class is similar toorg.jetbrains.mps.openapi.language.SConceptUtil, except for explicit walk algorithm and OOP-friendly style.
- 
- 
Constructor SummaryConstructors Constructor Description BreadthConceptHierarchyIterator(SAbstractConcept start)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Iterator<SAbstractConcept>iterator()SAbstractConceptnext()voidremove()- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.lang.IterableforEach, spliterator
 - 
Methods inherited from interface java.util.IteratorforEachRemaining
 
- 
 
- 
- 
- 
Constructor Detail- 
BreadthConceptHierarchyIteratorpublic BreadthConceptHierarchyIterator(@NotNull SAbstractConcept start) 
 
- 
 - 
Method Detail- 
iteratorpublic Iterator<SAbstractConcept> iterator() - Specified by:
- iteratorin interface- Iterable<SAbstractConcept>
 
 - 
hasNextpublic boolean hasNext() - Specified by:
- hasNextin interface- Iterator<SAbstractConcept>
 
 - 
nextpublic SAbstractConcept next() - Specified by:
- nextin interface- Iterator<SAbstractConcept>
 
 - 
removepublic void remove() - Specified by:
- removein interface- Iterator<SAbstractConcept>
 
 
- 
 
-