Package org.jetbrains.mps.util
Class DepthFirstConceptIterator
- java.lang.Object
- 
- org.jetbrains.mps.util.DepthFirstConceptIterator
 
- 
- All Implemented Interfaces:
- Iterable<SAbstractConcept>,- Iterator<SAbstractConcept>
 
 public class DepthFirstConceptIterator extends Object implements Iterable<SAbstractConcept>, Iterator<SAbstractConcept> Traverse hierarchy ofSConceptsfor a given concept (inclusive), visiting super-concepts first then super-interfaces in an order they were specified in super-concepts (breadth-like). FIXME make it truly breadth-first, for interface concepts as well. 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, the order would be ConceptB, ConceptA, I3, I4, I1, I2, I5, I1 Note, same concept may appear few times in this iterator, no unique filtering is done. UseUniqueIteratorif necessary. FIXME functionality of this class shall get exposed from SConcept API (likely, in addition to public iterator not to limit to single iteration approach, i.e. depth or breadth first).
- 
- 
Constructor SummaryConstructors Constructor Description DepthFirstConceptIterator(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- 
DepthFirstConceptIteratorpublic DepthFirstConceptIterator(@NotNull SAbstractConcept start) 
 
- 
 - 
Method Detail- 
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>
 
 - 
iteratorpublic Iterator<SAbstractConcept> iterator() - Specified by:
- iteratorin interface- Iterable<SAbstractConcept>
 
 
- 
 
-