Class CssTokenList.CssTokenIterator

  • Enclosing class:
    CssTokenList

    class CssTokenList.CssTokenIterator
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private com.google.common.base.Predicate<CssToken> filter  
      (package private) CssToken last  
      (package private) int lastRet  
      (package private) java.util.List<CssToken> list  
      (package private) int next  
    • Constructor Summary

      Constructors 
      Constructor Description
      CssTokenIterator​(com.google.common.base.Predicate<CssToken> filter, java.util.List<CssToken> list)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) com.google.common.base.Predicate<CssToken> filter()
      Get the filter that is currently being used for invocations of next() and hasNext()
      (package private) boolean hasNext()
      Using the constructor filter.
      (package private) boolean hasNext​(com.google.common.base.Predicate<CssToken> filter)
      Using the supplied filter.
      (package private) int index()
      Get the list index of the last element returned prior to filtering, or -1 if no element has yet been returned.
      (package private) CssToken next()
      Get the next token in the token list.
      (package private) CssToken next​(com.google.common.base.Predicate<CssToken> filter)
      Get the next token in the token list that matches the given filter, or NoSuchElementException if no more tokens exist.
      CssToken peek()
      Get the next token without advancing the iterators position.
      CssToken peek​(com.google.common.base.Predicate<CssToken> filter)
      Get the next token without advancing the iterators position.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • filter

        private final com.google.common.base.Predicate<CssToken> filter
      • list

        final java.util.List<CssToken> list
      • next

        int next
      • lastRet

        int lastRet
    • Constructor Detail

      • CssTokenIterator

        CssTokenIterator​(com.google.common.base.Predicate<CssToken> filter,
                         java.util.List<CssToken> list)
        Constructor.
        Parameters:
        filter - A filter Predicate that is applied to all tokens unless another Predicate is passed using #next(Predicate)
    • Method Detail

      • next

        CssToken next()
        Get the next token in the token list. This method uses the constructor filter.
      • next

        CssToken next​(com.google.common.base.Predicate<CssToken> filter)
        Get the next token in the token list that matches the given filter, or NoSuchElementException if no more tokens exist.
      • hasNext

        boolean hasNext()
        Using the constructor filter.
      • hasNext

        boolean hasNext​(com.google.common.base.Predicate<CssToken> filter)
        Using the supplied filter.
      • peek

        public CssToken peek()
        Get the next token without advancing the iterators position.
      • peek

        public CssToken peek​(com.google.common.base.Predicate<CssToken> filter)
        Get the next token without advancing the iterators position.
      • index

        int index()
        Get the list index of the last element returned prior to filtering, or -1 if no element has yet been returned.
      • filter

        com.google.common.base.Predicate<CssToken> filter()
        Get the filter that is currently being used for invocations of next() and hasNext()