Package rma.util
Class Queue
java.lang.Object
rma.util.Queue
- All Implemented Interfaces:
Serializable
,Priorities
A simple First-In First-Out Queue Object.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
inner class to store the data in the data storage object -
Field Summary
FieldsFields inherited from interface rma.util.Priorities
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement
(Object obj) 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 priorityget
(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
size()
Returns an int describing the size of the Queue.
-
Field Details
-
_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
Adds an Object to the the Queue with a normal priority.- Parameters:
obj
- The feature to be added to the Element attribute
-
addElement
add an object to the queue based on it's priority- Parameters:
obj
- The feature to be added to the Element attributepriority
- The feature to be added to the Element attribute
-
removeElement
Removes and returns the object at the top of the queue.- Returns:
- Description of the Returned Value
-
get
Returns the object at the top of the queue.- Returns:
-
indexOf
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
-