psdi.app.eventresponse

Class TimePriorityQueue

  • java.lang.Object
    • psdi.app.eventresponse.TimePriorityQueue


  • public class TimePriorityQueue
    extends java.lang.Object
    This class ensures that abandoned ERSets aren't left in memory of the Immediate List.
    • Constructor Summary

      Constructors 
      Constructor and Description
      TimePriorityQueue()
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      psdi.app.eventresponse.ERKey pop()
      Returns the key of the eldest entry.
      void push(psdi.app.eventresponse.ERKey key)
      Adds the key with the current date/time.
      void remove(psdi.app.eventresponse.ERKey key)
      Removes any entry with the given key.
      void setExpirationTime(int ms)
      Sets the time when keys are considered expired and will be released by the pop method.
      • Methods inherited from class java.lang.Object

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

      • TimePriorityQueue

        public TimePriorityQueue()
        Constructor
    • Method Detail

      • push

        public void push(psdi.app.eventresponse.ERKey key)
        Adds the key with the current date/time. Any existing entry with the key value is updated.
        Parameters:
        key -
      • remove

        public void remove(psdi.app.eventresponse.ERKey key)
        Removes any entry with the given key.
        Parameters:
        key -
      • setExpirationTime

        public void setExpirationTime(int ms)
        Sets the time when keys are considered expired and will be released by the pop method.
        Parameters:
        ms -
      • pop

        public psdi.app.eventresponse.ERKey pop()
        Returns the key of the eldest entry.
        Returns:
        The eldest entry who's time is expired. If no entry is expired, null is returned instead.