jds.collection
Class RingBufferQueue

java.lang.Object
  |
  +--jds.collection.RingBufferQueue

public class RingBufferQueue
extends java.lang.Object
implements Queue

Queue - collection with FIFO behavior; for use with book Classic Data Structures in Java by Timothy A Budd, published by Addison-Wesley, 2001.

See Also:
Collection, Serialized Form

Method Summary
 void addLast(java.lang.Object val)
          add a new value to end of the collection
 java.util.Enumeration elements()
          Yields enumerator for collection
 java.lang.Object getFirst()
          access the first value in collection
 boolean isEmpty()
          Determines whether the collection is empty
 void removeFirst()
          remove first value in collection
 int size()
          Determines number of elements in collection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isEmpty

public boolean isEmpty()
Determines whether the collection is empty
Returns:
true if the collection is empty

size

public int size()
Determines number of elements in collection
Returns:
number of elements in collection as integer

elements

public java.util.Enumeration elements()
Yields enumerator for collection
Returns:
an Enumeration that will yield the elements of the collection
See Also:
Enumeration

addLast

public void addLast(java.lang.Object val)
add a new value to end of the collection
Specified by:
addLast in interface Queue
Parameters:
value - element to be inserted into collection

getFirst

public java.lang.Object getFirst()
access the first value in collection
Specified by:
getFirst in interface Queue
Returns:
element at front of collection
Throws:
java.util.NoSuchElementException - no matching value

removeFirst

public void removeFirst()
remove first value in collection
Specified by:
removeFirst in interface Queue
Throws:
java.util.NoSuchElementException - no matching value