fr.ove.utils
Class Queue

java.lang.Object
  extended byfr.ove.utils.Queue
All Implemented Interfaces:
Queueable, java.io.Serializable

public class Queue
extends java.lang.Object
implements Queueable, java.io.Serializable

A queue.

Version:
1.0 28/06/2000
Author:
© 2000 DIRAT Laurent
See Also:
Serialized Form

Constructor Summary
Queue()
          The Constructor
 
Method Summary
 void clear()
          Clears the queue
 java.lang.Object dequeue()
          Removes the first element added into the queue.
 java.util.Enumeration elements()
          Returns an @see Enumeration of the elements in the queue.
 void enqueue(java.lang.Object element)
          Adds the specified element to the queue
 java.lang.Object[] getElements()
          Returns an array of the elements contained in the queue.
 boolean isEmpty()
          Checks if the queue is empty.
 java.lang.Object peek()
          Returns the first element added into the queue.
 java.lang.String toString()
          Returns a string representation of the queue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Queue

public Queue()
The Constructor

Method Detail

enqueue

public void enqueue(java.lang.Object element)
Adds the specified element to the queue

Specified by:
enqueue in interface Queueable

dequeue

public java.lang.Object dequeue()
Removes the first element added into the queue. Returns the element removed. null if the queue is empty.

Specified by:
dequeue in interface Queueable

peek

public java.lang.Object peek()
Returns the first element added into the queue. null if the queue is empty

Specified by:
peek in interface Queueable

isEmpty

public boolean isEmpty()
Checks if the queue is empty. Returns true if the queue is empty. false otherwise.

Specified by:
isEmpty in interface Queueable

clear

public void clear()
Clears the queue

Specified by:
clear in interface Queueable

elements

public java.util.Enumeration elements()
Returns an @see Enumeration of the elements in the queue.

Specified by:
elements in interface Queueable

getElements

public java.lang.Object[] getElements()
Returns an array of the elements contained in the queue.
If the queue is empty, returns null.


toString

public java.lang.String toString()
Returns a string representation of the queue



Copyright © 1999-2007 Universit?© de Nice Sophia-Antipolis, I3S, Ove SARL, DFKI and Universit?§t des Saarlandes. All Rights Reserved.