Interface Pollable<E>


  • public interface Pollable<E>
    The Pollable interface describes a component which supports element removal.
    Author:
    mf 2013.02.19
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      E poll()
      Removes and returns the next element, or returns null if none is present.
      E poll​(long timeout, TimeUnit unit)
      Removes and returns the next element, or returns null upon timeout.
    • Method Detail

      • poll

        E poll()
        Removes and returns the next element, or returns null if none is present.
        Returns:
        the next element or null
      • poll

        E poll​(long timeout,
               TimeUnit unit)
        throws InterruptedException
        Removes and returns the next element, or returns null upon timeout.
        Parameters:
        timeout - how long to wait before giving up, in units of unit
        unit - a TimeUnit determining how to interpret the timeout parameter
        Returns:
        the next element or null
        Throws:
        InterruptedException - if interrupted while waiting