Interface ShadowChainIterator<S,I>

All Superinterfaces:
Iterator<ShadowChainNode<S,I>>

public interface ShadowChainIterator<S,I> extends Iterator<ShadowChainNode<S,I>>
Iterates up a ShadowChain chain 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 scope getScopeTag().
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the results of the search at the point the iterator is stopped.
    Returns the scope tag of the shadow group that was last yielded.
    boolean
     
    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 Details

    • hasNext

      boolean hasNext()
      Specified by:
      hasNext in interface Iterator<S>
    • 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 by getResults() are shadowed in the previous groups that were yielded (unless they are the same symbols, in which case there could be eg duplicate imports).
      Specified by:
      next in interface Iterator<S>
    • getScopeTag

      I getScopeTag()
      Returns the scope tag of the shadow group that was last yielded.
      Throws:
      IllegalStateException - If next() 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 - If next() has not been called