Class TypeFilteredSymbolIterator

  • All Implemented Interfaces:
    SymbolIterator, java.lang.Iterable<Symbol>, java.util.Iterator<Symbol>

    public class TypeFilteredSymbolIterator
    extends java.lang.Object
    implements SymbolIterator
    Filters a symbol iterator to only return a specific symbol type
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Return true if there is a next symbol.
      java.util.Iterator<Symbol> iterator()  
      Symbol next()
      Get the next symbol or null if no more symbols.
      void remove()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • TypeFilteredSymbolIterator

        public TypeFilteredSymbolIterator​(SymbolIterator it,
                                          SymbolType type)
        Construct a new TypeFilteredSymbolIterator
        Parameters:
        it - the symbol iterator to filter
        type - the symbol type to filter on.
    • Method Detail

      • next

        public Symbol next()
        Description copied from interface: SymbolIterator
        Get the next symbol or null if no more symbols.

        NOTE: This deviates from the standard Iterator interface by returning null instead of throwing an exception.

        Specified by:
        next in interface java.util.Iterator<Symbol>
        Specified by:
        next in interface SymbolIterator
        See Also:
        SymbolIterator.next()
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<Symbol>
      • iterator

        public java.util.Iterator<Symbol> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<Symbol>