Class AbstractURLBuffer

  • All Implemented Interfaces:
    URLBuffer
    Direct Known Subclasses:
    SchedulingURLBuffer, SimpleURLBuffer

    public abstract class AbstractURLBuffer
    extends Object
    implements URLBuffer
    Abstract class for URLBuffer interface, meant to simplify the code of the implementations and provide some default methods
    Since:
    1.15
    • Constructor Detail

      • AbstractURLBuffer

        public AbstractURLBuffer()
    • Method Detail

      • numQueues

        public int numQueues()
        Total number of queues in the buffer *
        Specified by:
        numQueues in interface URLBuffer
      • add

        public boolean add​(String URL,
                           Metadata m,
                           String key)
        Stores the URL and its Metadata under a given key.
        Specified by:
        add in interface URLBuffer
        Returns:
        false if the URL was already in the buffer, true if it wasn't and was added
      • add

        public boolean add​(String URL,
                           Metadata m)
        Stores the URL and its Metadata using the hostname as key.
        Specified by:
        add in interface URLBuffer
        Returns:
        false if the URL was already in the buffer, true if it wasn't and was added
      • size

        public int size()
        Total number of URLs in the buffer *
        Specified by:
        size in interface URLBuffer
      • hasNext

        public boolean hasNext()
        Description copied from interface: URLBuffer
        Implementations of this method should be synchronised
        Specified by:
        hasNext in interface URLBuffer