All Packages Class Hierarchy This Package Previous Next Index
Interface structure.Queue
- public interface Queue
- extends Linear
A first-in, first-out structure. Values are added at the tail, and removed
from the head. Used to process values in the order that they appear.
- See Also:
- Stack
add(Object)
- Add a value to the tail of the queue.
dequeue()
- Remove a value from the head of the queue.
enqueue(Object)
- Add a value to the tail of the queue.
peek()
- Fetch the value at the head of the queue.
remove()
- Remove a value form the head of the queue.
add
public abstract void add(Object value)
- Add a value to the tail of the queue.
- Postcondition:
- the value is added to the tail of the structure
- Parameters:
- value - The value added.
- See Also:
- enqueue
enqueue
public abstract void enqueue(Object value)
- Add a value to the tail of the queue.
- Postcondition:
- the value is added to the tail of the structure
- Parameters:
- value - The value to be added.
remove
public abstract Object remove()
- Remove a value form the head of the queue.
- Precondition:
- the queue is not empty
- Postcondition:
- the head of the queue is removed and returned
- Returns:
- The value actually removed.
- See Also:
- dequeue
dequeue
public abstract Object dequeue()
- Remove a value from the head of the queue.
- Precondition:
- the queue is not empty
- Postcondition:
- the head of the queue is removed and returned
- Returns:
- The value removed from the queue.
peek
public abstract Object peek()
- Fetch the value at the head of the queue.
- Precondition:
- the queue is not empty
- Postcondition:
- the element at the head of the queue is returned
- Returns:
- Reference to the first value of the queue.
All Packages Class Hierarchy This Package Previous Next Index