Package rma.util

Class Queue

java.lang.Object
rma.util.Queue
All Implemented Interfaces:
Serializable, Priorities

public class Queue extends Object implements Serializable, Priorities
A simple First-In First-Out Queue Object.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    inner class to store the data in the data storage object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Vector
    The internal Data Storage Object.

    Fields inherited from interface rma.util.Priorities

    MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a new Queue.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an Object to the the Queue with a normal priority.
    void
    addElement(Object obj, int priority)
    add an object to the queue based on it's priority
    get(int position)
    Returns the object at the top of the queue.
    int
    Returns the priority of the object at the top of the queue.
    int
    getPriority(int position)
     
    int
    Searches for the first occurence of the given argument, testing for equality using the equals method.
    Removes and returns the object at the top of the queue.
    int
    Returns an int describing the size of the Queue.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _datastore

      protected Vector _datastore
      The internal Data Storage Object.
  • Constructor Details

    • Queue

      public Queue()
      Construct a new Queue.
  • Method Details

    • getPriority

      public int getPriority()
      Returns the priority of the object at the top of the queue.
      Returns:
      The Priority value
    • getPriority

      public int getPriority(int position)
    • addElement

      public void addElement(Object obj)
      Adds an Object to the the Queue with a normal priority.
      Parameters:
      obj - The feature to be added to the Element attribute
    • addElement

      public void addElement(Object obj, int priority)
      add an object to the queue based on it's priority
      Parameters:
      obj - The feature to be added to the Element attribute
      priority - The feature to be added to the Element attribute
    • removeElement

      public Object removeElement()
      Removes and returns the object at the top of the queue.
      Returns:
      Description of the Returned Value
    • get

      public Object get(int position)
      Returns the object at the top of the queue.
      Returns:
    • indexOf

      public int indexOf(Object obj)
      Searches for the first occurence of the given argument, testing for equality using the equals method.
      Returns:
      The index position as an int or -1.
    • size

      public int size()
      Returns an int describing the size of the Queue.
      Returns:
      Description of the Returned Value