Interface ShadowChainIterator<S,I>
-
- All Superinterfaces:
Iterator<ShadowChainNode<S,I>>
public interface ShadowChainIterator<S,I> extends Iterator<ShadowChainNode<S,I>>
Iterates up aShadowChainchain to find a given name. This can be used to find all shadowed declarations for a given name, or to find the reason why a declaration is in scopegetScopeTag().
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<S>getResults()Returns the results of the search at the point the iterator is stopped.IgetScopeTag()Returns the scope tag of the shadow group that was last yielded.booleanhasNext()ShadowChainNode<S,I>next()Returns the next node in the chain that contains a declaration for the name this iterator searches.-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Method Detail
-
next
ShadowChainNode<S,I> next()
Returns the next node in the chain that contains a declaration for the name this iterator searches. If that group exists (hasNext()) then the symbols yielded bygetResults()are shadowed in the previous groups that were yielded (unless they are the same symbols, in which case there could be eg duplicate imports).
-
getScopeTag
I getScopeTag()
Returns the scope tag of the shadow group that was last yielded.- Throws:
IllegalStateException- Ifnext()has not been called
-
getResults
List<S> getResults()
Returns the results of the search at the point the iterator is stopped. This list is nonempty.Note that a shadow chain iterator considers results node by node, it won't ask the next nodes in the tree.- Throws:
IllegalStateException- Ifnext()has not been called
-
-