Interface QueueStatus

All Known Implementing Classes:
AbstractWaitTaskQueue, DelayTaskQueue, FifoServerQueue, FifoTaskQueue, LifoServerQueue, LifoTaskQueue, LinearServerQueue, PriorityServerQueue, PriorityTaskQueue, ServerQueue, TaskQueue, WaitTaskQueue

public interface QueueStatus
Interface for obtaining state information about queues. This interface is used by QueueObserver. The queues provided in the org.bzdev.devqsim package implement this interface. As a result, the object representing a queue's status will be the queue itself. The rationale for this interface is that TaskQueue and ServerQueue are not subclasses of any type of queue. This interface provides operations common to both for querying properties of a queue and adding/removing observers.

The QueueObserver interface provides a single method that will be called when a queue's status changes. The type of this method's argument is an instance of QueueStatus (the queue itself for the queues defined in this package).

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add an observer.
    boolean
    Determine if a queue can be frozen.
    Get the name of the queue.
    int
    Determine how many servers are in use.
    boolean
    Determine if the queue is busy.
    boolean
    Determine if the queue has been deleted.
    boolean
    Determine if a queue is frozen.
    boolean
    Determine if the queue is interned by a simulation.
    void
    Remove an observer.
    int
    Determine the maximum number of servers.
    int
    Get the size of the queue.
  • Method Details

    • addObserver

      void addObserver(QueueObserver observer)
      Add an observer.
      Parameters:
      observer - the observer
    • removeObserver

      void removeObserver(QueueObserver observer)
      Remove an observer.
      Parameters:
      observer - the observer
    • isBusy

      boolean isBusy()
      Determine if the queue is busy. A queue is busy if all the servers are handling queue entries.
      Returns:
      true if the queue is busy; false otherwise
    • inUseCount

      int inUseCount()
      Determine how many servers are in use. Equivalent to how many customers are being served.
      Returns:
      the number of servers in use
    • serverCount

      int serverCount()
      Determine the maximum number of servers.
      Returns:
      the maximum number of servers
    • size

      int size()
      Get the size of the queue. The size does not include the currently scheduled event.
      Returns:
      the queue size
    • isFrozen

      boolean isFrozen()
      Determine if a queue is frozen.
      Returns:
      true if it is frozen; false otherwise
    • canFreeze

      boolean canFreeze()
      Determine if a queue can be frozen.
      Returns:
      true if a queue can be frozen; false otherwise
    • isDeleted

      boolean isDeleted()
      Determine if the queue has been deleted.
      Returns:
      true if the queue is deleted; false otherwise
    • getName

      String getName()
      Get the name of the queue.
      Returns:
      true if the queue is interned; false otherwise
    • isInterned

      boolean isInterned()
      Determine if the queue is interned by a simulation. A queue is interned if its simulation allows it to be looked up by name.
      Returns:
      true if the object is interned; false otherwise.