edu.colorado.collections
Class FloatLinkedQueue

java.lang.Object
  extended by edu.colorado.collections.FloatLinkedQueue
All Implemented Interfaces:
java.lang.Cloneable

public class FloatLinkedQueue
extends java.lang.Object
implements java.lang.Cloneable

A FloatLinkedQueue is a queue of float values.

Limitations:
Beyond Int.MAX_VALUE items, size is wrong.
Java Source Code for this class:
http://www.cs.colorado.edu/~main/edu/colorado/collections/FloatLinkedQueue.java

See Also:
FloatQueue, ObjectLinkedQueue, BooleanLinkedQueue, ByteLinkedQueue, CharLinkedQueue, DoubleLinkedQueue, IntLinkedQueue, LongLinkedQueue, ShortLinkedQueue

Constructor Summary
FloatLinkedQueue()
          Initialize an empty queue.
 
Method Summary
 java.lang.Object clone()
          Generate a copy of this queue.
 float getFront()
          Get the front item, removing it from this queue.
 void insert(float item)
          Put a new a new item in this queue.
 boolean isEmpty()
          Determine whether this queue is empty.
 int size()
          Accessor method to determine the number of items in this queue.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatLinkedQueue

public FloatLinkedQueue()
Initialize an empty queue.

Parameters:
- - none
Postcondition:
This queue is empty.
Method Detail

clone

public java.lang.Object clone()
Generate a copy of this queue.

Overrides:
clone in class java.lang.Object
Parameters:
- - none
Returns:
The return value is a copy of this queue. Subsequent changes to the copy will not affect the original, nor vice versa. Note that the return value must be type cast to an FloatLinkedQueue before it can be used.
Throws:
java.lang.OutOfMemoryError - Indicates insufficient memory for creating the clone.

getFront

public float getFront()
Get the front item, removing it from this queue.

Parameters:
- - none
Precondition:
This queue is not empty.
Postcondition:
The return value is the front item of this queue, and the item has been removed.
Throws:
java.util.NoSuchElementException - Indicates that this queue is empty.

insert

public void insert(float item)
Put a new a new item in this queue.

Parameters:
item - the item to be pushed onto this queue
Postcondition:
The item has been pushed onto this queue.
Throws:
java.lang.OutOfMemoryError - Indicates insufficient memory for increasing the queue's capacity.
Note:
An attempt to increase the capacity beyond Integer.MAX_VALUE will cause the queue to fail with an arithmetic overflow.

isEmpty

public boolean isEmpty()
Determine whether this queue is empty.

Parameters:
- - none
Returns:
true if this queue is empty; false otherwise.

size

public int size()
Accessor method to determine the number of items in this queue.

Parameters:
- - none
Returns:
the number of items in this queue