Class MemoryQueue

  • All Implemented Interfaces:
    IMailQueue

    public class MemoryQueue
    extends java.lang.Object
    implements IMailQueue
    MemoryQueue
    • Constructor Summary

      Constructors 
      Constructor Description
      MemoryQueue()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MailItem consume()
      Get a mail item from the list and remove it from the queue
      void send​(MailItem item)
      Put a mail item into the list of the queue
      int size()
      get the MemoryQueue size
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MemoryQueue

        public MemoryQueue()
    • Method Detail

      • send

        public void send​(MailItem item)
        Put a mail item into the list of the queue
        Specified by:
        send in interface IMailQueue
        Parameters:
        item - The mail item to add to the queue
      • consume

        public MailItem consume()
        Get a mail item from the list and remove it from the queue
        Specified by:
        consume in interface IMailQueue
        Returns:
        The older mail item of the queue
      • size

        public int size()
        get the MemoryQueue size
        Specified by:
        size in interface IMailQueue
        Returns:
        the MemoryQueue size